pandas dataframe column name: remove special character
Instead we can use lambda functions for removing special characters in the column like:
df2 = df1.rename(columns=lambda x: x.strip('*'))
use str.replace:df.columns=df.columns.str.replace('#','')
You can check this in the documentation.