How to Rename just One Column in Pandas

You can rename just one column using the rename() function in Python Pandas dataframes.

import pandas as pd
car_data = {'Brand': ['Tesla', 'Tesla','Tesla','Ford','Ford','Ford','Toyota','Toyota'], 
     'Location': ['CA', 'CA','NY','MA','CA','WA','CA','TX'],
    'Year':['2019','2018','2020','2019','2016','2010','2018','2021']}
car_data=pd.DataFrame(data=car_data)
print(car_data)
    Brand Location  Year
0   Tesla       CA  2019
1   Tesla       CA  2018
2   Tesla       NY  2020
3    Ford       MA  2019
4    Ford       CA  2016
5    Ford       WA  2010
6  Toyota       CA  2018
7  Toyota       TX  2021
car_data.rename(columns={'Brand':'Car_Brand'}, inplace=True)
print(car_data)
  Car_Brand Location  Year
0     Tesla       CA  2019
1     Tesla       CA  2018
2     Tesla       NY  2020
3      Ford       MA  2019
4      Ford       CA  2016
5      Ford       WA  2010
6    Toyota       CA  2018
7    Toyota       TX  2021