Utilities for working with data structures like lists, dicts and tuples.
Chop a sequence into chunks of the given size.
Flatten a list of lists (NOT recursive, only works for 2d lists).
Get a slice of a sequence with variable step. Specify start,stop,step.
Takes a list of (key,value) pairs and turns it into a dict.
Takes a list and turns it into a dict. Much slower than list2dict, but more versatile. This version can take lists with sublists of arbitrary length (including sclars).
Sort and compare two lists.
By default it does it in place, thus modifying the lists. Use inplace = 0 to avoid that (at the cost of temporary copy creation).
Return from an iterable, a list of all the unique elements in the input, but maintaining the order in which they first appear.
Note: All elements in the input must be hashable for this routine to work, as it internally uses a set for efficiency reasons.