Renaming Column In Pandas Doesn't Do Anything
I'm importing a CSV file which has the following header(column names): 'Appendix','Name / Organization','Issuer','Algorithm' I tried changing the 'Appendix' column name into 'Othe
Solution 1:
Some methods to sort this out:
Solution 2:
make sure column name doesn't have any invisible characters line space and'\n'. The key u give in df.replace
function should match the column name.
try theese
df.rename(columns={'df.columns[0]':'Other Info'},
inplace=True)
or
df.columns=["Other info","Name / Organization","Issuer","Algorithm"]
Post a Comment for "Renaming Column In Pandas Doesn't Do Anything"