Announcement: All noncommercial projects registered to use Earth Engine beforeApril 15, 2025 mustverify noncommercial eligibility to maintain access. If you have not verified by September 26, 2025, your access may be on hold.
ee.List.sequence Stay organized with collections Save and categorize content based on your preferences.
Page Summary
Generates a sequence of numbers between a start and end point with optional step or count parameters.
Either an end point or a count of increments must be specified.
The function takes
start,end,step, andcountas arguments, returning a List.The
stepargument is ignored ifcountis also provided.
| Usage | Returns |
|---|---|
ee.List.sequence(start,end,step,count) | List |
| Argument | Type | Details |
|---|---|---|
start | Number | The starting number. |
end | Number, default: null | The ending number. |
step | Number, default: 1 | The increment. |
count | Integer, default: null | The number of increments. |
Examples
Code Editor (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 elementsprint(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}));
Python setup
See the Python Environment page for information on the Python API and usinggeemap for interactive development.
importeeimportgeemap.coreasgeemap
Colab (Python)
display(ee.List.sequence(0,5))# [0, 1, 2, 3, 4, 5]display(ee.List.sequence(0,10,2))# [0, 2, 4, 6, 8, 10]display(ee.List.sequence(0,None,2,6))# [0, 2, 4, 6, 8, 10]display(ee.List.sequence(0,None,-2,6))# [0, -2, -4, -6, -8, -10]# Step ignored when present along with count.display(ee.List.sequence(0,10,2,999))# 999 elementsdisplay(ee.List.sequence(0,10,2,3))# [0, 5, 10]# Using a dictionary for arguments.display(ee.List.sequence(start=10,count=3))# [10, 11, 12]display(ee.List.sequence(start=3,step=2,end=6))# [3, 5]# [-1000000000, 0, 1000000000]display(ee.List.sequence(start=-1e9,end=1e9,count=3))
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-13 UTC.