ee.Array.max
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Wählt elementweise das Maximum des ersten und zweiten Werts aus.
Nutzung | Ausgabe |
---|
Array.max(right) | Array |
Argument | Typ | Details |
---|
So gehts: left | Array | Der Wert auf der linken Seite. |
right | Array | Der rechte Wert. |
Beispiele
Code-Editor (JavaScript)
var empty = ee.Array([], ee.PixelType.int8());
print(empty.max(empty)); // []
var array1 = ee.Array([0, -3, 5, 3]);
var array2 = ee.Array([0, -1, 2, 4]);
print(array1.max(array2)); // [0,-1,5,4]
Python einrichten
Informationen zur Python API und zur Verwendung von geemap
für die interaktive Entwicklung finden Sie auf der Seite
Python-Umgebung.
import ee
import geemap.core as geemap
Colab (Python)
empty = ee.Array([], ee.PixelType.int8())
display(empty.max(empty)) # []
array1 = ee.Array([0, -3, 5, 3])
array2 = ee.Array([0, -1, 2, 4])
display(array1.max(array2)) # [0, -1, 5, 4]
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\u003cp\u003e\u003ccode\u003eArray.max()\u003c/code\u003e is an element-wise function that returns an array containing the maximum values between two input arrays.\u003c/p\u003e\n"],["\u003cp\u003eThe function compares corresponding elements in the 'left' (this) and 'right' input arrays.\u003c/p\u003e\n"],["\u003cp\u003eIf both input arrays are empty, an empty array is returned.\u003c/p\u003e\n"],["\u003cp\u003eThe resulting array has the same dimensions as the input arrays, with each element representing the maximum between corresponding elements of the inputs.\u003c/p\u003e\n"]]],["The `Array.max(right)` function compares two arrays (`left` and `right`) element-wise. For each corresponding pair of elements, it selects the maximum value. It returns a new array containing these maximum values. Both input arrays must be of the same length. Example show that using this method with `[0, -3, 5, 3]` and `[0, -1, 2, 4]` will result in `[0, -1, 5, 4]` . An empty array compared to an empty array will also result in an empty array.\n"],null,["# ee.Array.max\n\nOn an element-wise basis, selects the maximum of the first and second values.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------|---------|\n| Array.max`(right)` | Array |\n\n| Argument | Type | Details |\n|--------------|-------|-----------------------|\n| this: `left` | Array | The left-hand value. |\n| `right` | Array | The right-hand value. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nvar empty = ee.Array([], ee.PixelType.int8());\nprint(empty.max(empty)); // []\n\nvar array1 = ee.Array([0, -3, 5, 3]);\nvar array2 = ee.Array([0, -1, 2, 4]);\nprint(array1.max(array2)); // [0,-1,5,4]\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\nempty = ee.Array([], ee.PixelType.int8())\ndisplay(empty.max(empty)) # []\n\narray1 = ee.Array([0, -3, 5, 3])\narray2 = ee.Array([0, -1, 2, 4])\ndisplay(array1.max(array2)) # [0, -1, 5, 4]\n```"]]