zhanghaitao1
4/8/2018 - 1:59 PM

convert frequency

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,:])