ee.Dictionary.fromLists

Stay organized with collections Save and categorize content based on your preferences.
Construct a dictionary from two parallel lists of keys and values.

UsageReturns
ee.Dictionary.fromLists(keys, values)Dictionary
ArgumentTypeDetails
keysList
valuesList

Examples

Code Editor (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));

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())