Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to rename columns in pandas dataframe

energy = energy.rename(columns={2: 'Country', 3: 'Energy Supply' , 4:'Energy Supply per Capita',5:'% Renewable'})
Source by pandas.pydata.org #
 
PREVIOUS NEXT
Tagged: #rename #columns #pandas #dataframe
ADD COMMENT
Topic
Name
8+5 =