How to zip a list of an arbitrary number of sublists so that you only recieve all sub-elements merged?
Have:
[[1,...],[2,...],[3,...],...]
Want:
[1, 2, 3,...]
How to zip a list of an arbitrary number of sublists so that you only recieve all sub-elements merged?
Have:
[[1,...],[2,...],[3,...],...]
Want:
[1, 2, 3,...]
using nested list-comprehension and the asteriks argument
list_of_lists = [[1],[2],[3]]
[j for i in zip(*list_of_lists) for j in i]
>>> [1, 2, 3]