ee.Array.argmax

แสดงผลตำแหน่งเป็นรายการดัชนีในแต่ละแกนของอาร์เรย์ของค่าสูงสุดในอาร์เรย์ หรือ null หากอาร์เรย์ว่างเปล่า หากมีค่าสูงสุดหลายค่า ฟังก์ชันจะแสดงตำแหน่งของค่าแรก

การใช้งานการคืนสินค้า
Array.argmax()รายการ
อาร์กิวเมนต์ประเภทรายละเอียด
ดังนี้ arrayอาร์เรย์

ตัวอย่าง

โปรแกรมแก้ไขโค้ด (JavaScript)

// Return the position of the maximum value in each dimension.

// Returns null if the array is empty.
print(ee.Array([], ee.PixelType.int8()).argmax());  // null

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

// Returns the first occurrence of the maximum.
print(ee.Array([1, 1, 1, 9, 9, 9]).argmax());  // [3]

การตั้งค่า Python

ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

import ee
import geemap.core as geemap

Colab (Python)

# Return the position of the maximum value in each dimension.

# Returns null if the array is empty.
display(ee.Array([], ee.PixelType.int8()).argmax())  # None

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

# Returns the first occurrence of the maximum.
display(ee.Array([1, 1, 1, 9, 9, 9]).argmax())  # [3]