Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
Stay organized with collections
Save and categorize content based on your preferences.
Map an algorithm over a dictionary. The algorithm is expected to take 2 arguments, a key from the existing dictionary and the value it corresponds to, and return a new value for the given key. If the algorithm returns null, the key is dropped.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-13 UTC."],[[["`Dictionary.map()` applies a provided algorithm to each key-value pair in a dictionary, transforming the values based on the algorithm's logic."],["The algorithm used by `Dictionary.map()` receives a key and its corresponding value as input, and it should return the new value for that key."],["If the algorithm returns null for a specific key, that key-value pair will be excluded from the resulting dictionary."],["`Dictionary.map()` is particularly useful for tasks like data transformation and filtering within dictionaries, offering a concise way to modify values based on custom logic."],["Example use cases include converting units of measurement within a dataset or selectively removing entries based on certain criteria applied to the key-value pairs."]]],["The core content details the `map` function for dictionaries. This function applies a user-defined algorithm to each key-value pair within a dictionary. The algorithm takes a key and its corresponding value as input and returns a new value. The `map` function iterates through the dictionary, executes the provided algorithm on each pair, and generates a new dictionary with the updated values. If the algorithm's result is `null`, the key is removed from the resulting dictionary. Examples illustrate this with scaling values in a dictionary.\n"]]