Say I have 2 dataframes and each dataframe has the same columns but hold different types of information.
Example:
animals_data = pd.DataFrame({'A':['Dog', 'Cat'], 'B': ['Horse', 'Donkey']})
numbers_data = pd.DataFrame({'A':[1, 2], 'B': [3, 4]})
My goal is to create a hierarchical (also known as MultiIndex) dataframe where the first level is Animals & Numbers, and then the second level is column A and column B.
That is,
MultiIndex_data['Animals']
A | B
-----------
Dog | Horse
Cat | Donkey
and
MultiIndex_data['Numbers']
A | B
-----
1 | 3
2 | 4
How can I go about doing this?