Python List Snippets
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.
Learn the difference between Python’s built-in list sorting methods and when one is preferred over the other.
Writing short, efficient Python code is not always straightforward. Read how we optimize our list snippets to increase performance using a couple of simple tricks.
Merges two or more lists into a list of lists, combining elements from each of the input lists based on their positions.
Understand Python's named tuples and start using them in your projects today.
Learn how Python's lists and tuples are different and level up your code today.
Groups the elements of a list based on the given function and returns the count of elements in each group.
Sorts one list based on another list containing the desired indexes.
Splits values into two groups, based on the result of the given filtering function.
Groups the elements of a list based on the given function.
Builds a list, using an iterator function and an initial seed value.
Learn everything you need to know about Python's slice notation with this handy guide.
Maps the values of a list to a dictionary using a function, where the key-value pairs consist of the original value as the key and the result of the function as the value.
Randomizes the order of the values of an list, returning a new list.
Learn everything you need to know about Python's slice assignment with this handy guide.
Returns the difference between two lists, after applying the provided function to each list element of both.