答案 0 :(得分:1)
看看这个文档:http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rename_axis.html
df2.index.name = None
df2.rename_axis("count", axis="columns", inplace=True)
与Wen said in the comment一样,这与在“列标题”中添加名称相同。
df2.columns.name = "count"