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

  • 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 takesstart,end,step, andcount as arguments, returning a List.

  • Thestep argument is ignored ifcount is also provided.

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.

UsageReturns
ee.List.sequence(start,end,step,count)List
ArgumentTypeDetails
startNumberThe starting number.
endNumber, default: nullThe ending number.
stepNumber, default: 1The increment.
countInteger, default: nullThe 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.