Background: I have covid data that I aggregated to the state level. Then I aggregated my days to the week level (this works). However, when I run the day to week logic with almost exactly the same data just at the county level I get an error. More specifically, I'm getting the same column in the index and in the data.
The left is the rolled-up state data and right rolled up county data...
Here is the state data code that is working...
df_covid_data = df_covid_data.groupby("State").resample('W-SAT', label='right', closed = 'right', on='date').sum().sort_values(by=['State','date'])
And here is the county code (basically identical) that is not working (note if I uncomment the end I get an error, because countyFIPS is included twice). I tried removing the nan columns and this did not help...
df_covid_data_c = df_covid_data_c.groupby("countyFIPS").resample('W-SAT', label='right', closed = 'right', on='date').sum()#.sort_values(by=['countyFIPS','date'])
PS to bring in the raw data...
COVID_FILE =
'covid_confirmed_usafacts' #https://usafacts.org/visualizations/coronavirus-covid-19-spread-map grab confirmed cases
df_cum_covid_data=pd.read_csv(DATA_PATH+COVID_FILE+'.csv', sep=',').dropna(axis=1, how='all').dropna(axis=0, how='all')#read in covid data