import pandas as pd
import numpy as np
df = pd.DataFrame({'key1':list('aabba'),
'key2': ['one','two','one','two','one'],
'data1': ['1','3','5','7','9'],
'data2': ['2','4','6','8','10']})
print(df)
grp = list(df.groupby('key1'))
import numpy as np
df = pd.DataFrame({'key1':list('aabba'),
'key2': ['one','two','one','two','one'],
'data1': ['1','3','5','7','9'],
'data2': ['2','4','6','8','10']})
print(df)
grp = list(df.groupby('key1'))
print(grp)
print(grp[0])
print(grp[0][0])print(grp[0][1])