ee.Dictionary.toArray

किसी डिक्शनरी की संख्या वाली वैल्यू को एक ऐरे के तौर पर दिखाता है. अगर कोई कुंजी नहीं दी जाती है, तो सभी वैल्यू, डिक्शनरी की कुंजियों के नैचुरल ऑर्डर में दिखती हैं. 'ऐक्सिस' की डिफ़ॉल्ट वैल्यू 0 होती है.

इस्तेमालरिटर्न
Dictionary.toArray(keys, axis)Array
आर्ग्यूमेंटटाइपविवरण
यह: 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 सेटअप करना

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