Dictionary¶
How To: Basic::Dictionary
Examples
Creating a Dictionary
Generate a dictionary of numbers (1..N) in form (x, x*x)
Print a dictionary where the keys (1..15) and values=key*key
Create a dictionary from a string tracking the count of the letters
Get a dictionary from an object’s fields
Convert a list into a nested dictionary of keys
Create a dictionary from two lists without losing duplicate values
Map two Lists into a dictionary
Print a dictionary line by line
Print a dictionary in table format
Concatenate dictionaries
Add a key
Remove a key
Iterate over dictionaries using for loops
Get the depth of a dictionary
Check if dictionary is empty or not
Check if a given key already exists
Check is set of keys exists in a dictionary
Match key:value is present in two dictionaries
Get the maximum and minimum value
Find the highest 3 values
Get the top three items
Combine values in list of dictionaries
Sum all the values
Multiply all the items
Replace dictionary values with their average
Get all combinations of letters from a different keys
Get all unique values in a dictionary
Get the key, value, and count
Count number of Items in a Dictionary Value that is a List
Count the values associated with key
Merge dictionaries
Sort (ascending and descending) by value
Sort by key
Sort Counter by Value
Sort lists in DOL alphabetically
Remove Duplicates (same values) from Dictionary
Remove spaces from keys
Combine two dictionaries adding values for common keys