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.List.sequence
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Genera una secuencia de números desde el inicio hasta el final (inclusive) en incrementos de paso o en incrementos de recuento con el mismo espaciado. Si no se especifica el final, se calcula a partir de start + step * count, por lo que se debe especificar al menos uno de los dos valores: end o count.
Uso | Muestra |
---|
ee.List.sequence(start, end, step, count) | Lista |
Argumento | Tipo | Detalles |
---|
start | Número | Es el número inicial. |
end | Número, valor predeterminado: nulo | Es el número final. |
step | Número, valor predeterminado: 1 | Es el incremento. |
count | Número entero, valor predeterminado: nulo | Es la cantidad de incrementos. |
Ejemplos
Editor de código (JavaScript)
print(ee.List.sequence(0, 5)); // [0,1,2,3,4,5]
print(ee.List.sequence(0, 10, 2)); // [0,2,4,6,8,10]
print(ee.List.sequence(0, null, 2, 6)); // [0,2,4,6,8,10]
print(ee.List.sequence(0, null, -2, 6)); // [0,-2,-4,-6,-8,-10]
// Step ignored when present along with count.
print(ee.List.sequence(0, 10, 2, 999)); // 999 elements
print(ee.List.sequence(0, 10, 2, 3)); // [0,5,10]
// Using a dictionary for arguments.
print(ee.List.sequence({start:10, count:3})); // [10,11,12]
print(ee.List.sequence({start:3, step:2, end:6})); // [3,5]
// [-1000000000,0,1000000000]
print(ee.List.sequence({start:-1e9, end:1e9, count:3}));
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)
print(ee.List.sequence(0, 5).getInfo()) # [0, 1, 2, 3, 4, 5]
print(ee.List.sequence(0, 10, 2).getInfo()) # [0, 2, 4, 6, 8, 10]
print(ee.List.sequence(0, None, 2, 6).getInfo()) # [0, 2, 4, 6, 8, 10]
print(ee.List.sequence(0, None, -2, 6).getInfo()) # [0, -2, -4, -6, -8, -10]
# Step ignored when present along with count.
print(ee.List.sequence(0, 10, 2, 999).getInfo()) # 999 elements
print(ee.List.sequence(0, 10, 2, 3).getInfo()) # [0, 5, 10]
# Using a dictionary for arguments.
print(ee.List.sequence(start=10, count=3).getInfo()) # [10, 11, 12]
print(ee.List.sequence(start=3, step=2, end=6).getInfo()) # [3, 5]
# [-1000000000, 0, 1000000000]
print(ee.List.sequence(start=-1e9, end=1e9, count=3).getInfo())
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\u003eee.List.sequence\u003c/code\u003e generates a list of numbers within a specified range, determined by \u003ccode\u003estart\u003c/code\u003e, \u003ccode\u003eend\u003c/code\u003e, \u003ccode\u003estep\u003c/code\u003e, and \u003ccode\u003ecount\u003c/code\u003e parameters.\u003c/p\u003e\n"],["\u003cp\u003eYou must define either the \u003ccode\u003eend\u003c/code\u003e or \u003ccode\u003ecount\u003c/code\u003e parameter alongside the \u003ccode\u003estart\u003c/code\u003e parameter to determine the sequence range.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003estep\u003c/code\u003e parameter defines the increment between numbers in the sequence and defaults to 1 if not specified.\u003c/p\u003e\n"],["\u003cp\u003eWhen both \u003ccode\u003estep\u003c/code\u003e and \u003ccode\u003ecount\u003c/code\u003e are specified, \u003ccode\u003estep\u003c/code\u003e is ignored and the sequence is divided into equally spaced increments based on \u003ccode\u003ecount\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can provide arguments as a dictionary using keys like \u003ccode\u003estart\u003c/code\u003e, \u003ccode\u003eend\u003c/code\u003e, \u003ccode\u003estep\u003c/code\u003e, and \u003ccode\u003ecount\u003c/code\u003e for better readability.\u003c/p\u003e\n"]]],[],null,["# ee.List.sequence\n\nGenerate a sequence of numbers from start to end (inclusive) in increments of step, or in count equally-spaced increments. If end is not specified it is computed from start + step \\* count, so at least one of end or count must be specified.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------------------------|---------|\n| `ee.List.sequence(start, `*end* `, `*step* `, `*count*`)` | List |\n\n| Argument | Type | Details |\n|----------|------------------------|---------------------------|\n| `start` | Number | The starting number. |\n| `end` | Number, default: null | The ending number. |\n| `step` | Number, default: 1 | The increment. |\n| `count` | Integer, default: null | The number of increments. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nprint(ee.List.sequence(0, 5)); // [0,1,2,3,4,5]\nprint(ee.List.sequence(0, 10, 2)); // [0,2,4,6,8,10]\nprint(ee.List.sequence(0, null, 2, 6)); // [0,2,4,6,8,10]\nprint(ee.List.sequence(0, null, -2, 6)); // [0,-2,-4,-6,-8,-10]\n\n// Step ignored when present along with count.\nprint(ee.List.sequence(0, 10, 2, 999)); // 999 elements\nprint(ee.List.sequence(0, 10, 2, 3)); // [0,5,10]\n\n// Using a dictionary for arguments.\nprint(ee.List.sequence({start:10, count:3})); // [10,11,12]\nprint(ee.List.sequence({start:3, step:2, end:6})); // [3,5]\n// [-1000000000,0,1000000000]\nprint(ee.List.sequence({start:-1e9, end:1e9, count: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\nprint(ee.List.sequence(0, 5).getInfo()) # [0, 1, 2, 3, 4, 5]\nprint(ee.List.sequence(0, 10, 2).getInfo()) # [0, 2, 4, 6, 8, 10]\nprint(ee.List.sequence(0, None, 2, 6).getInfo()) # [0, 2, 4, 6, 8, 10]\nprint(ee.List.sequence(0, None, -2, 6).getInfo()) # [0, -2, -4, -6, -8, -10]\n\n# Step ignored when present along with count.\nprint(ee.List.sequence(0, 10, 2, 999).getInfo()) # 999 elements\nprint(ee.List.sequence(0, 10, 2, 3).getInfo()) # [0, 5, 10]\n\n# Using a dictionary for arguments.\nprint(ee.List.sequence(start=10, count=3).getInfo()) # [10, 11, 12]\nprint(ee.List.sequence(start=3, step=2, end=6).getInfo()) # [3, 5]\n# [-1000000000, 0, 1000000000]\nprint(ee.List.sequence(start=-1e9, end=1e9, count=3).getInfo())\n```"]]