Get the row(s) which have the max value in groups using groupby Get the row(s) which have the max value in groups using groupby pandas pandas