python - How can I get useful data from lists in a list? -
The question is probably not very clear here. Here I have a list, like data structure:
[[221.86797965649234, 490], [306.5453090728297, 400], [307.362157064 96666, 842]]How can I use an efficient method to get a new list I am [494,400,842]?
Currently, my method
list = [[221.86797965649234, 490] [306.5453090728297, 400], [307.362157064 96666, 842]] n NewList = []: newList.append (n [1])
If the original list contains more than one million items, it will be very slow, is there any effective way?
Use:
& gt; & Gt; & Gt; List = [[221.86797965649234, 490], [306.5453090728297, 400], [307.362157064 96666, 842]] & gt; & Gt; & Gt; [1] [4, 0, 400, 842] In the list, if your list contains more than a million items and actually becomes a performance problem, So by storing it in a database or using another approach, which lets you access it more carefully.
Comments
Post a Comment