I have a list in the following form:
l0=[[('x0', 2), ('x1', 3)], [('x2', 5), ('x3', 7), ('x4', 1)]]
How one turns this into:
l=[2,3,5,7,1]
I tried:
l=[x[1] for x in l0]
which gives:
#[('x1', 3), ('x3', 7)]
Edit: In order not to lose track of elements is there also anyway to have the output as:
l=[[2,3],[5,7,1]]
So one does not use flattening.