我创建了一个多索引数据框,其列如下所示-
a | | b | c | d | d
nan | nan | nan | e | f
现在我必须把它写在excel表格中。 我试过了
df.to_excel(r'C:/Users/Surbhi/Downloads/nir.xlsx',index=False)
它给了我
NotImplementedError: Writing to Excel with MultiIndex columns and no index ('index'=False) is not yet implemented.
然后我试着
df.to_excel(r'C:/Users/Surbhi/Downloads/nir.xlsx',index=True)
并在excel表格中得到如下结构
a | b | c | d | d
e | e | e | e | f
我使用spyder和pandas 1.0.5版
请告诉我该怎么办。蒂亚
目前没有回答
相关问题 更多 >
编程相关推荐