ee.Array.not

On an element-wise basis, returns 0 if the input is non-zero, and 1 otherwise.

UsageReturns
Array.not()Array
ArgumentTypeDetails
this: inputArrayThe input array.

Examples

Code Editor (JavaScript)

var empty = ee.Array([], ee.PixelType.int8());
print(empty.not());  // []

print(ee.Array([0]).not());  // [1]
print(ee.Array([1]).not());  // [0]

print(ee.Array([-1, -0.1, 0, 0.1, 1]).not());  // [0,0,1,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)

empty = ee.Array([], ee.PixelType.int8())
display(empty.Not())  # []

display(ee.Array([0]).Not())  # [1]
display(ee.Array([1]).Not())  # [0]

display(ee.Array([-1, -0.1, 0, 0.1, 1]).Not())  # [0, 0, 1, 0, 0]