df_grouped = df_grouped.rename(columns={'count': 'count_max'})
df = pd.merge(df, df_grouped, how='left', on=['sp', 'mt'])
df = df[df['count'] == df['count_max']]
Python : Getting the Row which has the max value in groups using groupby