pandas Dataframe resampling with specific dates
问题 I have a question regarding the resampling method of pandas Dataframes. I have a DataFrame with one observation per day: import pandas as pd import numpy as np df = pd.DataFrame(np.random.randint(0,100,size=(366, 1)), columns=list('A')) df.index = pd.date_range(datetime.date(2016,1,1),datetime.date(2016,12,31)) if I want to compute the sum (or other) for every month, I can directly do: EOM_sum = df.resample(rule="M").sum() however I have a specific calendar (irregular frequency): import