I have dataframe
with dates in the form of columns. I would like to average the values from daily to monthly. I tried Time Grouper and Resample, but I don't like the column names, and I can figure out how to make the columns something like DatetimeIndex
.
My initial data frame:
import pandas as pd
df = pd.DataFrame(data=[[1,2,3,4],[5,6,7,8]],
columns=['2013-01-01', '2013-01-02', '2013-02-03', '2013-02-04'],
index=['A', 'B'])
Output Required:
2013-01-01 2013-02-01
A 1.5 3.5
B 5.6 7.5
source
share