ee.Dictionary.fromLists

Tạo một từ điển từ hai danh sách khoá và giá trị song song.

Cách sử dụngGiá trị trả về
ee.Dictionary.fromLists(keys, values)Từ điển
Đối sốLoạiThông tin chi tiết
keysDanh sáchDanh sách khoá.
valuesDanh sáchDanh sách các giá trị.

Ví dụ

Trình soạn thảo mã (JavaScript)

// Corresponding lists of keys and values.
var keys = ['B1', 'B2', 'B3'];
var values = [182, 219, 443];
print('Dictionary from lists of keys and values',
      ee.Dictionary.fromLists(keys, values));

Thiết lập Python

Hãy xem trang Môi trường Python để biết thông tin về API Python và cách sử dụng geemap cho quá trình phát triển tương tác.

import ee
import geemap.core as geemap

Colab (Python)

# Corresponding lists of keys and values.
keys = ['B1', 'B2', 'B3']
values = [182, 219, 443]
print('Dictionary from lists of keys and values:',
      ee.Dictionary.fromLists(keys, values).getInfo())