<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','Value'] columns?
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
df = pd.DataFrame({'Sp':['MM1','MM1','MM1','MM2','MM2','MM2','MM4','MM4','MM4'],
                   'Value':['S1','S1','S3','S3','S4','S4','S2','S2','S2'],
                   'Mt':['a','n','cb','mk','bg','dgd','rd','cb','uyi'],
                   'count':[3,2,5,8,10,1,2,2,7]})
def g(df):
    return df[df.groupby(['Sp', 'Value'])['count'].transform(max) == df['count']]
result = g(df.copy())
<END_TASK>