<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 min value for count column, after grouping by ['Sp','Mt'] columns?
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
df = pd.DataFrame({'Sp': ['MM1', 'MM1', 'MM1', 'MM2', 'MM2', 'MM2', 'MM4', 'MM4', 'MM4'],
                   'Mt': ['S1', 'S1', 'S3', 'S3', 'S4', 'S4', 'S2', 'S2', 'S2'],
                   'Value': ['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', 'Mt'])['count'].transform(min) == df['count']]
result = g(df.copy())
<END_TASK>