I have a csv file named 'datavalues.csv'. It has about 20,000 values and I am curious as to how many of those values are over 10,000.
I have the below code, but I keep getting the following error ValueError: I/O operation on closed file
#!/usr/bin/python
import csv
with open('datavalues.csv', 'rb') as datavalues:
datavaluesreader = csv.reader(datavalues, delimiter=',')
print(sum(x >= 10000 for x in datavaluesreader))