Why isn't my attempt to rename columns working? I could swear I am following the right syntax and I am not getting any errors... it's simply not doing it.
import numpy as np
import pandas as pd
header = list(range(17))
energy = pd.read_excel('Energy Indicators.xls',
usecols = [2, 3, 4, 5],
skiprows = list(range(17)),
skipfooter = 38)
energy.rename(columns={'Unnamed: 2': 'Country',
'Petajoules': 'Energy Supply',
'Gigajoules': 'Energy Supply per Capita',
'%': '% Renewable'})
