ee.Dictionary.remove

지정된 키가 삭제된 사전을 반환합니다.

사용반환 값
Dictionary.remove(selectors, ignoreMissing)딕셔너리
인수유형세부정보
다음과 같은 경우: dictionary딕셔너리
selectors목록삭제할 키 이름 또는 키 이름의 정규 표현식 목록입니다.
ignoreMissing불리언, 기본값: false하나 이상의 키와 일치하지 않는 선택기를 무시합니다.

코드 편집기 (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('Dictionary with selected keys removed', dict.remove(['B2', 'B3']));

print('Set ignoreMissing as true to avoid an unmatched key error',
      dict.remove({selectors: ['B2', 'B3', 'Region'], ignoreMissing: true}));

Python 설정

Python API 및 geemap를 사용한 대화형 개발에 관한 자세한 내용은 Python 환경 페이지를 참고하세요.

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('Dictionary with selected keys removed:',
      dic.remove(['B2', 'B3']).getInfo())

dic_subset = dic.remove(**{'selectors': ['B2', 'B3', 'Region'],
                          'ignoreMissing': True})
print('Set ignoreMissing as true to avoid an unmatched key error:',
      dic_subset.getInfo())