Reputation: 1
Trying to convert this dataframe(df_long) into a multi-index dataframe (df_wide)
Imported this data from yfinance. New to python so would really appreciate the help :)
Upvotes: 0
Views: 278
Reputation: 1164
To get rid of the multi-index, use .reset_index()
:
df_long.pivot_table(index=["Data"],
columns='tickers',
values='grade').reset_index()
Upvotes: 1