能否请您帮我将数据框df转换为ff
import pandas as pd
d = {'col1': [1, 2,1,2,1,2], 'col2': [6,8,9,5,3, 4]}
df = pd.DataFrame(data=d,index=['A','A','B','B','C','C'])
print(df)
col1 col2
A 1 6
A 2 8
B 1 9
B 2 5
C 1 3
C 2 4
收件人:
1 2
A 6 8
B 9 5
C 3 4