ee.Array.subtract

要素ごとに、最初の値から 2 番目の値を減算します。

用途戻り値
Array.subtract(right)配列
引数タイプ詳細
これ: left配列左側の値。
right配列右側の値。

コードエディタ(JavaScript)

print(ee.Array([10]).subtract(1));  // [9]

print(ee.Array([-1, 0, 1]).subtract(2));  // [-3,-2,-1]
print(ee.Array([-1, 0, 1]).subtract([-5, 6, 7]));  // [4,-6,-6]

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

Python の設定

Python API とインタラクティブな開発での geemap の使用については、 Python 環境のページをご覧ください。

import ee
import geemap.core as geemap

Colab(Python)

display(ee.Array([10]).subtract(1))  # [9]

display(ee.Array([-1, 0, 1]).subtract(2))  # [-3, -2, -1]
display(ee.Array([-1, 0, 1]).subtract([-5, 6, 7]))  # [4, -6, -6]

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