xsv
xsv copied to clipboard
Adding rows together based on column value
I have a CSV where data is split by county, month, and year. I'd like to add the rows in the county column based on month and year so that I have a row for each month (I essentially don't care about the county). Could you point me in the right direction?
When asking questions, please always provide as much detail as possible. Otherwise, it's too difficult to help. In this case, please provide example inputs and outputs.
Here is a row from the CSV
COUNTY AGENCY NAME NCIC_AGENCY_CODE MONTH YEAR OFFICERS_KILLED_FELONY OFFICERS_KILLED_ACCIDENT
Alameda County Alameda Co. Sheriff's Department 100.0 1.0 2000.0 0.0 0.0
I'd like the output to look like
MONTH YEAR OFFICERS_KILLED_FELONY OFFICERS_KILLED_ACCIDENT
1.0 2000.0 0.0 0.0