find 1st element of each 1d list of 2d lisyt in pythn
Answers
Answered by
0
You can get the index [0] from each element in a list comprehension
>>> [i[0] for i in a]
[4.0, 3.0, 3.5]
Also just to be pedantic, you don't have a list of list, you have a tuple of tuple.
>>> [i[0] for i in a]
[4.0, 3.0, 3.5]
Also just to be pedantic, you don't have a list of list, you have a tuple of tuple.
Similar questions