Created
April 13, 2019 00:40
Revisions
-
StrikingLoo created this gist
Apr 13, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ def add_indicator_to(dictionary, indicator): indicator_data = df[df['indicator_name']==indicator] zipped_values = zip(list(indicator_data['iso3']), list(indicator_data['2017'])) for k, v in zipped_values: try: dictionary[k][indicator] = v except: print("failed with key: "+k+" on "+indicator) indic = {} indicators = [ 'Share of seats in parliament (% held by women)', 'Infants lacking immunization, measles (% of one-year-olds)', 'Youth unemployment rate (female to male ratio)', 'Expected years of schooling (years)', 'Expected years of schooling, female (years)', 'Expected years of schooling, male (years)', 'Unemployment, total (% of labour force)', 'Unemployment, youth (% ages 15–24)', 'Vulnerable employment (% of total employment)', ] for indicator in indicators: add_indicator_to(indic, indicator)