I have list, its elements are also a list. eg:
outlier=[[20,2,67], [90,6,12], [23,16,7]].
how I write a single line code to loop outlier
list by taking elements from same index.I want to store the looping result as a list.
I have list, its elements are also a list. eg:
outlier=[[20,2,67], [90,6,12], [23,16,7]].
how I write a single line code to loop outlier
list by taking elements from same index.I want to store the looping result as a list.
The question is not very clear to me, but if you want to make a new list that contains the first element of each list you have, then this is an example to take first element(x[0]) from each list and store them in a new list called "new_list":
new_list = [x[0] for x in outlier]