Thursday, June 13, 2019

Find Maximum Values by year in timeseries dataframe, keeping the date


df2=df1.ix[df1.groupby(df1.index.year).idxmax().iloc[:,0]]

No comments:

Post a Comment