ee.Dictionary.set

在字典中設定值。

用量傳回
Dictionary.set(key, value)字典
引數類型詳細資料
這個:dictionary字典
key字串
value物件

範例

程式碼編輯器 (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('Set value for B3 key as -9999', dict.set('B3', -9999));

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('Set value for B3 key as -9999:', dic.set('B3', -9999).getInfo())