ee.Dictionary
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک دیکشنری جدید می سازد.
استفاده | برمی گرداند | ee.Dictionary( dict ) | فرهنگ لغت |
استدلال | تایپ کنید | جزئیات | dict | ComputedObject|شیء، اختیاری | یک شی برای تبدیل به فرهنگ لغت. این سازنده انواع زیر را می پذیرد: 1) دیکشنری دیگر. 2) لیستی از جفت های کلید/مقدار. 3) یک آرگومان تهی یا بدون (تولید یک فرهنگ لغت خالی) |
نمونه ها
ویرایشگر کد (جاوا اسکریپت)
// A dictionary input (e.g. results of ee.Image.reduceRegion of an S2 image).
var dict = {
B1: 182,
B2: 219,
B3: 443
};
print('ee.Dictionary from dictionary input', ee.Dictionary(dict));
// A list of key/value pairs (from previous dictionary).
var list = [
'B1', 182,
'B2', 219,
'B3', 443
];
print('ee.Dictionary from list input', ee.Dictionary(list));
// To create an ee.Dictionary from two corresponding lists of keys and values,
// use the ee.Dictionary.fromLists constructor.
var keys = ['B1', 'B2', 'B3'];
var values = [182, 219, 443];
print('Dictionary from lists of keys and values',
ee.Dictionary.fromLists(keys, values));
راه اندازی پایتون
برای اطلاعات در مورد API پایتون و استفاده از geemap
برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.
import ee
import geemap.core as geemap
کولب (پایتون)
# A dictionary input (e.g. results of ee.Image.reduceRegion of an S2 image).
dic = {
'B1': 182,
'B2': 219,
'B3': 443
}
print('ee.Dictionary from dictionary input:', ee.Dictionary(dic).getInfo())
# A list of key/value pairs (from previous dictionary).
lst = [
'B1', 182,
'B2', 219,
'B3', 443
]
print('ee.Dictionary from list input', ee.Dictionary(lst).getInfo())
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eCreates a new Earth Engine Dictionary object to store key-value pairs.\u003c/p\u003e\n"],["\u003cp\u003eAccepts dictionary, list of key/value pairs, or no arguments as input to the constructor.\u003c/p\u003e\n"],["\u003cp\u003eEnables data organization and manipulation, such as representing image band values with corresponding band names.\u003c/p\u003e\n"],["\u003cp\u003eProvides flexibility in creating dictionaries from various input types, including existing dictionaries and lists.\u003c/p\u003e\n"]]],[],null,["# ee.Dictionary\n\n\u003cbr /\u003e\n\nConstructs a new Dictionary.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------|------------|\n| `ee.Dictionary(`*dict*`)` | Dictionary |\n\n| Argument | Type | Details |\n|----------|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `dict` | ComputedObject\\|Object, optional | An object to convert to a dictionary. This constructor accepts the following types: 1) Another dictionary. 2) A list of key/value pairs. 3) A null or no argument (producing an empty dictionary) |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// A dictionary input (e.g. results of ee.Image.reduceRegion of an S2 image).\nvar dict = {\n B1: 182,\n B2: 219,\n B3: 443\n};\nprint('ee.Dictionary from dictionary input', ee.Dictionary(dict));\n\n// A list of key/value pairs (from previous dictionary).\nvar list = [\n 'B1', 182,\n 'B2', 219,\n 'B3', 443\n];\nprint('ee.Dictionary from list input', ee.Dictionary(list));\n\n// To create an ee.Dictionary from two corresponding lists of keys and values,\n// use the ee.Dictionary.fromLists constructor.\nvar keys = ['B1', 'B2', 'B3'];\nvar values = [182, 219, 443];\nprint('Dictionary from lists of keys and values',\n ee.Dictionary.fromLists(keys, values));\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# A dictionary input (e.g. results of ee.Image.reduceRegion of an S2 image).\ndic = {\n 'B1': 182,\n 'B2': 219,\n 'B3': 443\n}\nprint('ee.Dictionary from dictionary input:', ee.Dictionary(dic).getInfo())\n\n# A list of key/value pairs (from previous dictionary).\nlst = [\n 'B1', 182,\n 'B2', 219,\n 'B3', 443\n]\nprint('ee.Dictionary from list input', ee.Dictionary(lst).getInfo())\n```"]]