Professional Documents
Culture Documents
July 2, 2017
boardapprovaldate borrower \
0 2013-11-12T00:00:00Z FEDERAL DEMOCRATIC REPUBLIC OF ETHIOPIA
1 2013-11-04T00:00:00Z GOVERNMENT OF TUNISIA
2 2013-11-01T00:00:00Z MINISTRY OF FINANCE AND ECONOMIC DEVEL
3 2013-10-31T00:00:00Z MIN. OF PLANNING AND INT'L COOPERATION
4 2013-10-31T00:00:00Z MINISTRY OF FINANCE
closingdate country_namecode \
0 2018-07-07T00:00:00Z Federal Democratic Republic of Ethiopia!$!ET
1 NaN Republic of Tunisia!$!TN
2 NaN Tuvalu!$!TV
3 NaN Republic of Yemen!$!RY
4 2019-04-30T00:00:00Z Kingdom of Lesotho!$!LS
1
0 ... ET,BS,ES,EP IBRD
1 ... BZ,BS IBRD
2 ... TI IBRD
3 ... JB IBRD
4 ... FH,YW,YZ IBRD
status supplementprojectflg \
0 Active N
1 Active N
2 Active Y
3 Active N
4 Active N
theme1 \
0 {'Name': 'Education for all', 'Percent': 100}
1 {'Name': 'Other economic management', 'Percent...
2 {'Name': 'Regional integration', 'Percent': 46}
3 {'Name': 'Participation and civic engagement',...
4 {'Name': 'Export development and competitivene...
totalcommamt url
0 130000000 http://www.worldbank.org/projects/P129828/ethi...
1 4700000 http://www.worldbank.org/projects/P144674?lang=en
2 6060000 http://www.worldbank.org/projects/P145310?lang=en
3 1500000 http://www.worldbank.org/projects/P144665?lang=en
4 13100000 http://www.worldbank.org/projects/P144933/seco...
[5 rows x 50 columns]
In [183]: m_data.columns
2
'sectorcode', 'source', 'status', 'supplementprojectflg', 'theme1'
'theme_namecode', 'themecode', 'totalamt', 'totalcommamt', 'url'],
dtype='object')
0.1.2 2. Find the top 10 major project themes (using column mjtheme_namecode)
In [199]: theme = m_data['mjtheme_namecode']
theme[0]
Out[199]: [{'code': '8', 'name': 'Human development'}, {'code': '11', 'name': ''}]
0.1.3 3. In 2. above you will notice that some entries have only the code and the name is
missing. Create a dataframe with the missing names filled in.
In [185]: # create a ref
complete_theme = new_theme[new_theme.name !=""]
3
uniq_theme = complete_theme.drop_duplicates()
name_dict = uniq_theme.set_index("code").to_dict()["name"] # code as inde
name_dict
In [192]: name_dict["1"]
4
1495 9 Urban development
1496 8 Human development
1497 5 Trade and integration
1498 4 Financial and private sector development]