I come up with a dataframe like this, I wonder how can we change or drop the \'id\' and \'date\' as they are just the names for index and columns.
id
Option 1
rename_axis
df.rename_axis(None, 1, inplace=True) # 1 is for axis=1
Option 2
reassign df.columns
df.columns = df.columns.tolist()
Option 3
Setting the name
attribute, as described by Boud.
df.columns.name = None
df.index.name = None
These variables are represented through the name
property:
df.columns.name = None
df.index.name = None