ee.Dictionary.toArray

مقادیر عددی یک فرهنگ لغت را به صورت آرایه برمی گرداند. اگر هیچ کلیدی مشخص نشده باشد، همه مقادیر به ترتیب طبیعی کلیدهای فرهنگ لغت برگردانده می شوند. "محور" پیش فرض 0 است.

استفاده برمی گرداند
Dictionary. toArray ( keys , axis ) آرایه
استدلال تایپ کنید جزئیات
این: dictionary فرهنگ لغت
keys لیست، پیش فرض: null
axis عدد صحیح، پیش فرض: 0

نمونه ها

ویرایشگر کد (جاوا اسکریپت)

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

راه اندازی پایتون

برای اطلاعات در مورد API پایتون و استفاده از geemap برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.

import ee
import geemap.core as geemap

کولب (پایتون)

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