spiketools.utils.base.flatten

spiketools.utils.base.flatten(lst)[source]

Flatten a list of lists into a single list.

Parameters:
lstlist of list

A list of embedded lists.

Returns:
lst

A flattened list.

Examples

Flatten a list containing three embedded lists:

>>> lst = [[1, 2, 3, 4], [5, 6, 7 ,8], [9, 10, 11, 12]]
>>> flatten(lst)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]