fromPairs#

geetools.ee_dictionary.DictionaryAccessor.fromPairs(list)#

Create a dictionary from a list of [[key, value], ...]] pairs.

Parameters:

list (DictionaryAccessor.fromPairs.list | ee.List) – A list of pairs (key, value).

Returns:

A dictionary using the pairs.

Return type:

ee.Dictionary

Examples

import ee, geetools
from geetools.utils import initialize_documentation

initialize_documentation()

d = ee.Dictionary.geetools.fromPairs([["foo", 1], ["bar", 2]])
d.getInfo()
{'bar': 2, 'foo': 1}