ee.Array.argmax
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह फ़ंक्शन, किसी अरे में मौजूद सबसे बड़ी वैल्यू की पोज़िशन दिखाता है. यह पोज़िशन, हर अरे ऐक्सिस में इंडेक्स की सूची के तौर पर होती है. अगर अरे खाली है, तो यह फ़ंक्शन शून्य दिखाता है. अगर सबसे बड़ी वैल्यू एक से ज़्यादा बार मौजूद है, तो यह फ़ंक्शन पहली बार मौजूद वैल्यू की पोज़िशन दिखाता है.
इस्तेमाल | रिटर्न |
---|
Array.argmax() | सूची |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: array | 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]
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 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```"]]