I have a following dataframe:
In [1]: df.head()
Out[1]:
A B C
0 2.0 0.01 0.15748
1 2.0 0.02 0.01188
2 2.0 0.03 0.09856
3 2.0 0.04 0.04584
4 2.0 0.05 0.08280
Now, I want to create a new dataframe df2
such that the values in column A
would be its index values and values in the column B
would be its column values and the values in the cell (A, B) would be the corresponding C value. Is there any simple way to do this?