convert frequency
df=df.resample('M').agg(lambda x:x[-1]) #TODO:this two method is equaly # df2=df.groupby(lambda dt:dt+MonthEnd(0)).apply(lambda x:x.iloc[-1,:])