ee.Array.neq
On an element-wise basis, returns 1 if and only if the first value is not equal to the second.
Usage | Returns |
---|
Array.neq(right) | Array |
Argument | Type | Details |
---|
this: left | Array | The left-hand value. |
right | Array | The right-hand value. |
Examples
var empty = ee.Array([], ee.PixelType.int8());
print(empty.neq(empty)); // []
print(ee.Array([0]).neq(ee.Array([1]))); // 1
print(ee.Array([1]).neq(ee.Array([1]))); // 0
print(ee.Array([1.1]).neq(ee.Array([1.1]))); // 0
print(ee.Array([1.1]).float().neq(ee.Array([1.1]))); // 1
print(ee.Array([1.1]).double().neq(ee.Array([1.1]))); // 0
print(ee.Array([1]).int8().neq(ee.Array([1]))); // 0
print(ee.Array([1]).int8().neq(ee.Array([1]).int32())); // 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
empty = ee.Array([], ee.PixelType.int8())
display(empty.neq(empty)) # []
display(ee.Array([0]).neq(ee.Array([1]))); # 1
display(ee.Array([1]).neq(ee.Array([1]))); # 0
display(ee.Array([1.1]).neq(ee.Array([1.1]))) # 0
display(ee.Array([1.1]).float().neq(ee.Array([1.1]))) # 1
display(ee.Array([1.1]).double().neq(ee.Array([1.1]))) # 0
display(ee.Array([1]).int8().neq(ee.Array([1]))) # 0
display(ee.Array([1]).int8().neq(ee.Array([1]).int32())) # 0
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-12-06 UTC.
[null,null,["Last updated 2023-12-06 UTC."],[[["`Array.neq()` is an Earth Engine function that performs an element-wise comparison of two arrays, returning 1 if the corresponding elements are not equal and 0 if they are equal."],["The function takes two arguments: `left` (the first array) and `right` (the second array), and it returns a new array with the comparison results."],["It's essential to be aware of data types when using `neq()`, as comparisons between different data types (e.g., float and double) might yield unexpected results due to floating-point representation."],["The function returns an empty array (`[]`) if either input array is empty."]]],[]]