Reputation: 1920
using
pd_now.set_index("a")
We could make column "a" adding to the index of the "row index", making "row index" a multiindex object
However, I did not find any way to add a row "b" to the "column index", making "column index" a multiindex object. Did I miss anything? Thank you.
Upvotes: 0
Views: 77
Reputation: 323226
Using T
and set_index
df.T.set_index(['a','b']).T
If you need add one
df.T.set_index('b',append=True).T
Upvotes: 1