<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:
I have a dataframe containing 2 columns: id and val. I want to get a running sum of val for each id:
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
df = pd.DataFrame.from_dict({'id': ['A', 'B', 'A', 'C', 'D', 'B', 'C'],
                             'val': [1,2,-3,1,5,6,-2],
                             'stuff':['12','23232','13','1234','3235','3236','732323']})
def g(df):
    df['cumsum'] = df.groupby('id')['val'].transform(pd.Series.cumsum)
    return df
df = g(df.copy())
<END_TASK>