标签: python-3.x pandas dataframe
尝试将此数据帧(df_long)转换为多索引数据帧(df_wide)
从 yfinance 导入此数据。刚接触 Python,所以非常感谢您的帮助 :)
enter image description here
答案 0 :(得分:0)
要摆脱多索引,请使用 .reset_index():
.reset_index()
df_long.pivot_table(index=["Data"], columns='tickers', values='grade').reset_index()
pandas.DataFrame.reset_index