1>gapminder.rename(columns={'pop':'population',
2 'lifeExp':'life_exp',
3 'gdpPercap':'gdp_per_cap'},
4 inplace=True)
5
6>print(gapminder.columns)
7
8Index([u'country', u'year', u'population', u'continent', u'life_exp',
9 u'gdp_per_cap'],
10 dtype='object')
11
12>gapminder.head(3)
13
14 country year population continent life_exp gdp_per_cap
150 Afghanistan 1952 8425333 Asia 28.801 779.445314
161 Afghanistan 1957 9240934 Asia 30.332 820.853030
172 Afghanistan 1962 10267083 Asia 31.997 853.100710
18