Search code examples
google-colaboratorygoogle-earth-engine

Boolean calculation: Do 'and' and 'And' share the same meaning in colab?


I have two codes about image mask in Google colab:

(1)

mask1 = img1.gt(0.5) and img2.lt(1.2)

(2)

mask2 = img1.gt(0.5).And(img2.lt(1.2))

Are they different?

Does mask1 equal mask2?


Solution

  • These are two different things. And() is a server-side operation and and is a client-side operation. You have to use the server-side operation for this. You can read up on client- vs server-side here.