ee.Dictionary.values

以清單形式傳回字典的值。如未指定任何鍵,系統會按照字典鍵的自然順序傳回所有值。

用量傳回
Dictionary.values(keys)清單
引數類型詳細資料
這個:dictionary字典
keys清單,預設值為空值

範例

程式碼編輯器 (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('Values for selected keys converted to ee.List',
      dict.values(['B1', 'B2']));
print('Values for all keys converted to ee.List', dict.values());

Python 設定

請參閱 Python 環境頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

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('Values for selected keys converted to ee.List:',
      dic.values(['B1', 'B2']).getInfo())
print('Values for all keys converted to ee.List:', dic.values().getInfo())