ee.Array.lt

以元素為單位,只有在第一個值小於第二個值時,才會傳回 1。

用量傳回
Array.lt(right)陣列
引數類型詳細資料
這個:left陣列左側值。
right陣列右側值。

範例

程式碼編輯器 (JavaScript)

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

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

print(ee.Array([-1, 0, 1]).lt([-2, 1, 0]));  // [0,1,0]

Python 設定

請參閱 Python 環境頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

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

display(ee.Array([0]).lt([0]))  # [0]
display(ee.Array([1]).lt([2]))  # [1]
display(ee.Array([2]).lt([1]))  # [0]

display(ee.Array([-1, 0, 1]).lt([-2, 1, 0]))  # [0, 1, 0]