Invert dictionary
Inverts a dictionary with non-unique hashable values.
The Python snippet collection contains helper functions for Python 3.6. It includes utilities for most common data types, such as primitivies, lists, dictionaries and date objects.
Inverts a dictionary with non-unique hashable values.
Combines two or more dictionaries, creating a list of values for each key.
Groups the elements of a list based on the given function.
Sorts the given dictionary by value.
Retrieves the value of the nested key indicated by the given selector list from a dictionary or list.
Maps the values of a list to a dictionary using a function.
Checks if the a value is an empty sequence or collection.
Understand Python's named tuples and start using them in your projects today.
Converts a list of dictionaries into a list of values corresponding to the specified key
.
Inverts a dictionary with unique hashable values.
Merges two or more dictionaries.
Learn how to sort a Python dictionary list using a tuple key.
Sorts the given dictionary by key.
Creates a dictionary with the same keys as the provided dictionary and values generated by running the provided function for each value.
Finds all keys in the provided dictionary that have the given value.
Combines two lists into a dictionary, using the first one as the keys and the second one as the values.
Converts a dictionary to a list of tuples.
Creates a flat list of all the keys in a flat dictionary.
Learn the difference between two common ways to access values in Python dictionaries and level up your code today.
Returns a flat list of all the values in a flat dictionary.
Finds the key of the maximum value in a dictionary.
Finds the key of the minimum value in a dictionary.
Finds the first key in the provided dictionary that has the given value.
Checks if the given key exists in a dictionary.