ee.List.sequence

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
startNumber

endNumber, default: null

stepNumber, default: 1

countInteger, default: null

Examples

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}));

Python

# Your example goes here!