Rename hundred or more column names in pandas dataframe
Thanks for the time and effort but I figured out a simple way.
for i, row in enumerate(df):
df.rename(columns = { row : str(i)}, inplace = True)
to change the columns names and then
for i, row in enumerate(df):
df.rename(columns = { row : str( i + 43853)}, inplace = True)
to change them back to the dates I want.
I am working with the John Hopkins Covid data for personal use to create charts.  The data shows cumulative deaths by country, I want deaths per day.  Seems to me the easiest way is to create two dataframes and subtract one from the other.  But the file has column names as dates and the code, e.g. df3 = df2 - df1 subtracts the columns with the matching dates.  So I want to rename all the columns with some easy index, for example, 1, 2, 3, ....
I cannot figure out how to do this?