Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas dataframe rename column

df = df.rename(columns={'oldName1': 'newName1', 'oldName2': 'newName2'})
# Or rename the existing DataFrame (rather than creating a copy) 
df.rename(columns={'oldName1': 'newName1', 'oldName2': 'newName2'}, inplace=True)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #dataframe #rename #column
ADD COMMENT
Topic
Name
7+3 =