I have this dataframe:
And I'd like to unstack (or melt? or pivot?) the dataframe so that for every Coupon
in the index, the SMM_diff
gets its own column.
Something like:
SMM_diff_2.0 SMM_diff_2.5 ... rest of coupons
y_m
2020-05-01 -0.010935 -0.011007 ...
2019-02-01 0.007838 -0.007824
2021-04-01 0.029721 -0.004892
2020-07-01 -0.011197 -0.018712
2022-01-01 0.14557 -0.001675 ...
... ...
I'm not really sure how to approach this problem to be honest, so any help would be appreciated. Thanks!