Pengumuman: Semua project nonkomersial yang terdaftar untuk menggunakan Earth Engine sebelum
15 April 2025 harus
memverifikasi kelayakan nonkomersial untuk mempertahankan akses Earth Engine.
ee.List.sequence
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Buat urutan angka dari awal hingga akhir (inklusif) dengan kelipatan langkah, atau dengan kelipatan yang berjarak sama. Jika end tidak ditentukan, end akan dihitung dari start + step * count, jadi setidaknya salah satu dari end atau count harus ditentukan.
Penggunaan | Hasil |
---|
ee.List.sequence(start, end, step, count) | Daftar |
Argumen | Jenis | Detail |
---|
start | Angka | Angka awal. |
end | Angka, default: null | Angka akhir. |
step | Angka, default: 1 | Peningkatan. |
count | Bilangan bulat, default: null | Jumlah inkremen. |
Contoh
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 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}));
Penyiapan Python
Lihat halaman
Lingkungan Python untuk mengetahui informasi tentang Python API dan penggunaan
geemap
untuk pengembangan interaktif.
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())
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
[null,null,["Terakhir diperbarui pada 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```"]]