Following is the code
weekly = (df.groupby(['Year','Qtr_Year'], as_index=False).agg(High=('High', 'max'),D_HIGH='High','idxmax')))
I want to use idxmax and find corresponding date in agg. only similarly for idxmin and find date value. like below
weekly = (df.groupby(['Year','Qtr_Year'], as_index=False).agg(High=('High', 'max'),D_HIGH=('High', 'idxmax'), Date_High('Date',----)))
I tried df.loc and corresponding idxmax and idxmin.