These seems like something very simple, but search as I might I just can\'t get past it.
I have a CSV file like this:
Day,Event,Value 1,\"Rent\",500
Considering the first line of csv file is 'Day,Event,Value', you can use a generator expression with sum()
csv
'Day,Event,Value'
generator expression
sum()
>>> cr = csv.reader(open("file.csv","rb")) >>> cr.next() >>> print sum(int(x[2]) for x in cr) 1500