I literally have a data frame that look like this, and week over a week it's filling up more data, so I'm trying to make a pivot table with multi-index column but no luck
print (df)
week level letter pieces value
0 1 first A 10 $5
1 1 first B 15 $10
2 1 first C 15 $8
3 1 second D 5 $10
4 1 second E 10 $5
5 1 second A 15 $10
6 2 first A 5 $10
7 2 first B 10 $5
8 2 first C 10 $5
9 2 second D 15 $10
10 2 second E 15 $8
11 2 second A 15 $10
I'm looking to transform this data into this, I've tried pd.pivot_table but doesn't work either pandas or any other library :

this is the code that I'm using:
pt = df.pivot_table(
index=['level', 'letter'],
columns='week',
values=['pieces', 'value' ], aggfunc='sum')