using DataFrames, DataFramesMeta df = DataFrame(x = [1,1,1,2,2,2], y = [1,2,3,101,102,103], z = [5, 6, 7, 505, 506, 507]) gdf = groupby(df, :x) @combine(gdf, :MaxY = maximum(:y))
Above is MWE. I group by x column and find the max of y column and need the corresponding value of z being returned for each group’s max y value.
I am not sure how to get the corresponding z value? Help appreciated