Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
Stay organized with collections
Save and categorize content based on your preferences.
Generate 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-13 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,["Generate 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\nCode 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\nColab (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```"]]