Duyuru:
15 Nisan 2025'ten önce Earth Engine'i kullanmak için kaydedilen tüm ticari olmayan projelerin Earth Engine erişimini sürdürmek için
ticari olmayan uygunluğu doğrulaması gerekir.
ee.Array.argmax
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Bir dizideki maksimum değerin konumunu her dizi eksenindeki dizinlerin listesi olarak döndürür veya dizi boşsa null değerini döndürür. Maksimum değer birden çok kez geçiyorsa ilk değerin konumunu döndürür.
Kullanım | İadeler |
---|
Array.argmax() | Liste |
Bağımsız Değişken | Tür | Ayrıntılar |
---|
bu: array | Dizi | |
Örnekler
Kod Düzenleyici (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 kurulumu
Python API'si ve etkileşimli geliştirme için geemap
kullanımı hakkında bilgi edinmek üzere
Python Ortamı sayfasına bakın.
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]
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-27 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eArray.argmax()\u003c/code\u003e returns the position of the maximum value within an array as a list of indices.\u003c/p\u003e\n"],["\u003cp\u003eIf multiple maximum values exist, the function returns the position of the first occurrence.\u003c/p\u003e\n"],["\u003cp\u003eAn empty array input results in a \u003ccode\u003enull\u003c/code\u003e (JavaScript) or \u003ccode\u003eNone\u003c/code\u003e (Python) output.\u003c/p\u003e\n"],["\u003cp\u003eThe function operates across all dimensions of the input array.\u003c/p\u003e\n"]]],["The `argmax()` function finds the position of the maximum value within an array. It returns a list of indices, representing the location in each array dimension. If the array is empty, it returns null. In cases of multiple maximum values, it returns the index of the first occurrence. Usage is `Array.argmax()`, and it takes one array argument. Examples illustrate its behavior with empty, single-value, multi-value, and multi-dimensional arrays.\n"],null,["# ee.Array.argmax\n\nReturns the position, as a list of indices in each array axis, of the maximum value in an array, or null if the array is empty. If there are multiple occurrences of the maximum, returns the position of the first.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------|---------|\n| Array.argmax`()` | List |\n\n| Argument | Type | Details |\n|---------------|-------|---------|\n| this: `array` | Array | |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Return the position of the maximum value in each dimension.\n\n// Returns null if the array is empty.\nprint(ee.Array([], ee.PixelType.int8()).argmax()); // null\n\nprint(ee.Array([9]).argmax()); // [0]\nprint(ee.Array([0, -1, 2, 1]).argmax()); // [2]\nprint(ee.Array([[3, 4, 2], [6, 5, 7]]).argmax()); // [1, 2]\n\n// Returns the first occurrence of the maximum.\nprint(ee.Array([1, 1, 1, 9, 9, 9]).argmax()); // [3]\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# Return the position of the maximum value in each dimension.\n\n# Returns null if the array is empty.\ndisplay(ee.Array([], ee.PixelType.int8()).argmax()) # None\n\ndisplay(ee.Array([9]).argmax()) # [0]\ndisplay(ee.Array([0, -1, 2, 1]).argmax()) # [2]\ndisplay(ee.Array([[3, 4, 2], [6, 5, 7]]).argmax()) # [1, 2]\n\n# Returns the first occurrence of the maximum.\ndisplay(ee.Array([1, 1, 1, 9, 9, 9]).argmax()) # [3]\n```"]]