Hello, 

I got a csv file, in which I have to count the occurrences of certain
numbers in columns. I can do this for one arbitrary column, but not for
all.

The problem I encountered is as follows. Iterating through the rows of a
file works, but as soon as I try to iterate through the same file again,
it seems it returns nothing.

Code-example
------------
import csv
file = csv.reader(open("some.csv", "rb"))
for i in file:
        print i

for i in file:
        print i

some.csv:
3, 4, 5
4, 3, 2

The above program only returns:
['3', ' 4', ' 5']
['4', ' 3', ' 2']

instead of:
['3', ' 4', ' 5']
['4', ' 3', ' 2']
['3', ' 4', ' 5']
['4', ' 3', ' 2']

Any help would be welcome.

John

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to