Add all values in a CSV column in Python

后端 未结 4 1221
不知归路
不知归路 2021-01-19 23:11

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
         


        
4条回答
  •  北恋
    北恋 (楼主)
    2021-01-19 23:43

    Make a garbage value and read in the first 2 values and "trash" them then when reading in the 3rd value add it to your sum. Don't forget that initially you need to ignore the first 3 values of the file since it will pick up the headers.

提交回复
热议问题