python : getting the row which has the max value in groups using groupby,df[df['count'] == df.groupby(['Mt'])['count'].transform(max)]