python: How to compare values in a list by row?
i need to convert a csv into a list and count the amount of 'z's in a row
and print out the row headers of 5 rows with the top amount of Z's. Also
links to more help would be great! thank you
Here is my current code
economistData = open('C:/foo.csv','r')
economistDataList = []s
for line in economistData:
economistDataList.append(line.split(','))
for row in economistDataList:
rowcnt = row.count('z')
No comments:
Post a Comment