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.
Python, List
Groups the elements of a list based on the given function.
Python, List
Randomizes the order of the values of an list, returning a new list.
Python, Dictionary
Sorts the given dictionary by value.
Python, Function
Mutable default arguments can trip up Python beginners and veterans alike. Here's a quick workaround to deal with them.
Python, List
Maps the values of a list to a dictionary using a function.
Python, List
Returns the difference between two lists, after applying the provided function to each list element of both.
Python, Dictionary
Retrieves the value of the nested key indicated by the given selector list from a dictionary or list.
Python, List
Returns a list of elements that exist in both lists, after applying the provided function to each list element of both.
Python, List
Returns the symmetric difference between two lists, after applying the provided function to each list element of both.
Python, List
Returns every element that exists in any of the two lists once, after applying the provided function to each element of both.
Python, Math
Converts a number to a list of digits.
Python, List
Finds the index of the first element in the given list that satisfies the provided testing function.
Python, List
Finds the indexes of all elements in the given list that satisfy the provided testing function.
Python, List
Finds the index of the last element in the given list that satisfies the provided testing function.
Python, List
Converts a list of dictionaries into a list of values corresponding to the specified key
.