ee.Dictionary.toArray

Возвращает числовые значения словаря в виде массива. Если ключи не указаны, все значения возвращаются в естественном порядке ключей словаря. Значение по умолчанию — 0.

Использование Возврат
Dictionary. toArray ( keys , axis ) Множество
Аргумент Тип Подробности
это: dictionary Словарь
keys Список, по умолчанию: null
axis Целое число, по умолчанию: 0

Примеры

Редактор кода (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.Array',
      dict.toArray(['B1', 'B2']));
print('Values for all keys converted to ee.Array',
      dict.toArray());

Настройка Python

Информацию об API Python и использовании 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('Values for selected keys converted to ee.Array:',
      dic.toArray(['B1', 'B2']).getInfo())
print('Values for all keys converted to ee.Array:',
      dic.toArray().getInfo())