Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement