DEV Community

GharamElhendy
GharamElhendy

Posted on

Renaming a Specific Column in Pandas

Importing and Parsing

import pandas as pd
df = pd.read_csv('file_name.csv')
df.head()


Check the column's name you want to change, and then:

df.rename(columns={'old_name':'new_name'}, inplace=True)


Top comments (0)