I have a dataframe that looks somewhat like this:
Ax Ay Bx By
0 1 20 2 20
1 3 21 5 22
2 4 20 7 25
and I want to manually define that Ax and Ay have the hierarchical higher MultiIndex level of A (and also do the same for B). So that the dataframe looks like this:
A B
x y x y
0 1 20 2 20
1 3 21 5 22
2 4 20 7 25
So what I'm looking for is a statement that says:
Ax and Ay go under A as x and y