I have an issue with multiindex assignment and will like to store values as highlighted below
I have a function called df_x that is a dataframe and looks like
print df_x
serial P1 P2 P3
5 21 32 35
10 33 45 76
15 65 99 563
I will like it to store as follows
For example for level[0] of value alpha
df1 = pd.DataFrame(columns= df_x.columns)
it should create a multiindex on df1 so that
print df1 should look like
print df1
alpha serial 5 10 15
P1 21 33 65
P2 32 45 99
P3 35 76 563
However, I am struggling to create multiindex on original df_x dataframe
Any help will be highly appreciated.