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))  # []