<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
How do I find all rows in a pandas DataFrame which have the max value for count column, after grouping by ['Sp','Mt'] columns?
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
df = pd.DataFrame({'Sp':['MM2','MM2','MM4','MM4','MM4'],
                   'Mt':['S4','S4','S2','S2','S2'],
                   'Value':['bg','dgd','rd','cb','uyi'],
                   'count':[10,1,2,8,8]})
def g(df):
    return df[df.groupby(['Sp', 'Mt'])['count'].transform(max) == df['count']]
result = g(df.copy())
<END_TASK>