I am quite new to pandas.
Basically, I have 10 different type of data for different firms in 10 dfs. Eg Total Assets, AUM, etc.
For each type of data, there could have high or low importance: H, or L.
For each type of data, there could have 3 categories: Cat1, Cat2, Cat3.
For H importance, I need to analyse the data by the 3 categories. Same for L importance.
I am thinking of adding a mulit-index for each column of data after merging the 10 dfs. Is that possible?
Current State
**df_1**
|Total Assets|
Firm 1| 100 |
Firm 2| 200 |
Firm 3| 300 |
**df_2**
|AUMS |
Firm 1| 300 |
Firm 2| 3400 |
Firm 3| 800 |
Firm 4| 800 |
and so on until df_10. Also the firms for all the df could differ.
Desired Output
**Merged_df**
Importance| L | H |
Category | Cat1 | Cat2 |
|Total Assets| AUMs |
Firm 1 | 100 | 300 |
Firm 2 | 200 | 3400 |
Firm 3 | 300 | 800 |
Firm 4 | NaN | 800 |
Next, I need to do a Groupby "Importance" and "Category". Any other solution besides Multi-indexing is welcome. Thank you!