ee.Dictionary.toArray

Retorna valores numéricos de um dicionário como uma matriz. Se nenhuma chave for especificada, todos os valores serão retornados na ordem natural das chaves do dicionário. O "eixo" padrão é 0.

UsoRetorna
Dictionary.toArray(keys, axis)Matriz
ArgumentoTipoDetalhes
isso: dictionaryDicionário
keysLista, padrão: nulo
axisNúmero inteiro, padrão: 0

Exemplos

Editor de código (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());

Configuração do Python

Consulte a página Ambiente Python para informações sobre a API Python e como usar geemap para desenvolvimento interativo.

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())