ee.Dictionary.keys

Retrieve the keys of a dictionary as a list. The keys will be sorted in natural order.
UsageReturns
Dictionary.keys()List
ArgumentTypeDetails
this: dictionaryDictionary

Examples

Code Editor (JavaScript)

// A dictionary (e.g. results of ee.Image.reduceRegion of an S2 image).
var dict = ee.Dictionary({
  B1: 182,
  B2: 219,
  B3: 443
});

print('The list of dictionary keys', dict.keys());

Colab (Python)

# A dictionary (e.g. results of ee.Image.reduceRegion of an S2 image).
dic = ee.Dictionary({
    'B1': 182,
    'B2': 219,
    'B3': 443
})

print('The list of dictionary keys:', dic.keys().getInfo())