MareArts ANPR mobile app

Image
Showing posts with label python array. Show all posts
Showing posts with label python array. Show all posts

12/14/2017

arrays - How to access a column(or row) in a list of lists in python

OK, we have like that list:

ListOfList = [ ['abcd',1], ['efgh',2], ['ijkl',3]]
print(ListOfList)

Image

Let access list in list.
print('row 0', [row[0] for row in ListOfList] )
print('row 1', [row[1] for row in ListOfList] )

Image


Very easy isn't it?
Enjoy~!