So I have a list of lists in python that is something like this:
[[[0, 1, 0, 1, 0]]
[[1, 1, 1, 1, 1]]
[[1, 0, 0, 1, 1]]
[[0, 1, 0, 0, 0]]]
I want to flatten this list and end up with this:
[[0, 1, 0, 1, 0]
[1, 1, 1, 1, 1]
[1, 0, 0, 1, 1]
[0, 1, 0, 0, 0]]
Is there a straightforward way to do this in python?
list(chain.from_iterable(l))