- I am learning
stack()
/unstack()
in Pandas - Link to the excel file is here. The data in the file looks as under:
-
My code is as under:
<code> import pandas as pddf = pd.read_excel("stocks.xlsx",header=[0,1]) # on local machinedf</code><code> import pandas as pd df = pd.read_excel("stocks.xlsx",header=[0,1]) # on local machine df </code>import pandas as pd df = pd.read_excel("stocks.xlsx",header=[0,1]) # on local machine df
-
The output looks as under:
- The required output is as under:
The question:
-
Why am I not getting the required output? What is wrong with code?
-
Since I am not getting required output, I cannot work further on the data.
-
Please guide me. Thanks.