I have a df, and when I run df.columns, I get the result in the screenshot I am attaching. I do not understand what is the result in red referring to. Furthermore, I would like to have no "name".
CodePudding user response:
Use rename_axis
:
ri_2 = ri_2.rename_axis(None, axis=1)
CodePudding user response:
A simplified picture of what is df.columns is "it is a list of column names".
But it is only a simplified view. Actually it is an Index, something like a pandasonic Series, so it can have a name (as each Series).
One of possible options is to set it to None:
df.columns.name = None