Pandas rename column by position?
You can do this:
df.rename(columns={ df.columns[1]: "whatever" })
try this
df.rename(columns={ df.columns[1]: "your value" }, inplace = True)
You can do this:
df.rename(columns={ df.columns[1]: "whatever" })
try this
df.rename(columns={ df.columns[1]: "your value" }, inplace = True)