Rename unnamed column pandas dataframe
Try the below code,
df.columns = [‘A’, ‘B’, ‘C’, ‘D’]
My csv file has no column name for the first column, and I want to rename it. Usually, I would do data.rename(columns={'oldname':'newname'}, inplace=True), but there is no name in the csv file, just ''.