Last active
August 23, 2018 00:23
-
-
Save parulnith/d2a39f5ec32e3f7407e2df704311cc18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# select Life expectancy for females for all countries in 2013 | |
hist_indicator = 'Life expectancy at birth' | |
hist_year = 2013 | |
mask1 = data['IndicatorName'].str.contains(hist_indicator) | |
mask2 = data['Year'].isin([hist_year]) | |
# apply our mask | |
stage = data[mask1 & mask2] | |
stage.head() | |
#Creating a data frame with just the country codes and the values we want plotted. | |
data_to_plot = stage[['CountryCode','Value']] | |
data_to_plot.head() | |
# labelling the legend | |
hist_indicator = stage.iloc[0]['IndicatorName'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment