Anuncio: Todos los proyectos no comerciales registrados para usar Earth Engine antes del
15 de abril de 2025 deben
verificar su elegibilidad no comercial para mantener el acceso a Earth Engine.
ee.Array.max
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Selecciona el máximo de los valores primero y segundo para cada elemento.
Uso | Muestra |
---|
Array.max(right) | Array |
Argumento | Tipo | Detalles |
---|
esta: left | Array | Es el valor del lado izquierdo. |
right | Array | Es el valor del lado derecho. |
Ejemplos
Editor de código (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]
Configuración de Python
Consulta la página
Entorno de Python para obtener información sobre la API de Python y el uso de geemap
para el desarrollo interactivo.
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]
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-26 (UTC)
[null,null,["Última actualización: 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```"]]