ee.Number.and

Returns 1 if and only if both values are non-zero.
Usage Returns
Number. and (right) Number
Argument Type Details
this: left
Number The left-hand value.
right
Number The right-hand value.

Examples

Code Editor (JavaScript)

 print 
 ( 
 'Both 5 and 10 are not 0?' 
 , 
  
 ee 
 . 
 Number 
 ( 
 5 
 ). 
 and 
 ( 
 ee 
 . 
 Number 
 ( 
 10 
 ))); 
  
 // 1 
 print 
 ( 
 'Both 5 and 0 are not 0?' 
 , 
  
 ee 
 . 
 Number 
 ( 
 5 
 ). 
 and 
 ( 
 ee 
 . 
 Number 
 ( 
 0 
 ))); 
  
 // 0 

Python setup

See the Python Environment page for information on the Python API and using geemap for interactive development.

 import 
  
 ee 
 import 
  
 geemap.core 
  
 as 
  
 geemap 

Colab (Python)

 # 1 
 print 
 ( 
 'Both 5 and 10 are not 0?' 
 , 
 ee 
 . 
 Number 
 ( 
 5 
 ) 
 . 
 And 
 ( 
 ee 
 . 
 Number 
 ( 
 10 
 )) 
 . 
 getInfo 
 ()) 
 # 0 
 print 
 ( 
 'Both 5 and 0 are not 0?' 
 , 
 ee 
 . 
 Number 
 ( 
 5 
 ) 
 . 
 And 
 ( 
 ee 
 . 
 Number 
 ( 
 0 
 )) 
 . 
 getInfo 
 ()) 
Create a Mobile Website
View Site in Mobile | Classic
Share by: