ee.Dictionary.fromLists
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
कुंजियों और वैल्यू की दो समानांतर सूचियों से डिक्शनरी बनाएं.
इस्तेमाल | रिटर्न |
---|
ee.Dictionary.fromLists(keys, values) | शब्दकोश |
आर्ग्यूमेंट | टाइप | विवरण |
---|
keys | सूची | कुंजियों की सूची. |
values | सूची | वैल्यू की सूची. |
उदाहरण
कोड एडिटर (JavaScript)
// Corresponding lists of keys and values.
var keys = ['B1', 'B2', 'B3'];
var values = [182, 219, 443];
print('Dictionary from lists of keys and values',
ee.Dictionary.fromLists(keys, values));
Python सेटअप करना
Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap
का इस्तेमाल करने के बारे में जानकारी पाने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# Corresponding lists of keys and values.
keys = ['B1', 'B2', 'B3']
values = [182, 219, 443]
print('Dictionary from lists of keys and values:',
ee.Dictionary.fromLists(keys, values).getInfo())
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eee.Dictionary.fromLists()\u003c/code\u003e creates an Earth Engine Dictionary object from two parallel lists, where the first list provides the keys and the second list provides the corresponding values.\u003c/p\u003e\n"],["\u003cp\u003eThis function is useful for organizing data in a key-value structure, allowing for easy access to values using their associated keys within the Earth Engine environment.\u003c/p\u003e\n"],["\u003cp\u003eThe function accepts two arguments: \u003ccode\u003ekeys\u003c/code\u003e (a list of keys) and \u003ccode\u003evalues\u003c/code\u003e (a list of values), which must be of the same length to ensure proper pairing.\u003c/p\u003e\n"]]],["The function `ee.Dictionary.fromLists(keys, values)` creates a dictionary from two lists. The `keys` list provides the dictionary's keys, while the `values` list supplies the corresponding values. Both arguments require list types. The function returns a dictionary. In the provided examples, a dictionary is created using keys `['B1', 'B2', 'B3']` and corresponding values `[182, 219, 443]`.\n"],null,["# ee.Dictionary.fromLists\n\nConstruct a dictionary from two parallel lists of keys and values.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------|------------|\n| `ee.Dictionary.fromLists(keys, values)` | Dictionary |\n\n| Argument | Type | Details |\n|----------|------|-------------------|\n| `keys` | List | A list of keys. |\n| `values` | List | A list of values. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Corresponding lists of keys and values.\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# Corresponding lists of keys and values.\nkeys = ['B1', 'B2', 'B3']\nvalues = [182, 219, 443]\nprint('Dictionary from lists of keys and values:',\n ee.Dictionary.fromLists(keys, values).getInfo())\n```"]]