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
import country_converter | |
import pandas as pd | |
custom_mapping = pd.DataFrame.from_dict( | |
{ | |
"name_short": ["Africa", "Latin"], | |
"name_official": ["RoW Africa", "RoW Latin America"], | |
"regex": ["restafrica", "restlatin"], | |
"ISO2": ["WA", "WL"], |
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
""" Parse Global Health Data Exchange (GHDx) / Global Burden of Disease (GBD) numeric country codes for coco | |
This needs only to be done once, but might be a good guide for other inputs as well | |
Data sources: | |
- GHDx: http://ghdx.healthdata.org/ | |
- Codebook with country codes: ghdx.healthdata.org/sites/default/files/ihme_query_tool/IHME_GBD_2019_CODEBOOK.zip | |
""" |
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
In [1]: import pymrio | |
In [2]: tt = pymrio.load_test().calc_all() | |
In [3]: tnew = tt.copy() | |
In [4]: Ynew = tnew.Y.copy() | |
In [5]: Ynew.loc['reg1', 'reg1'] = Ynew.loc['reg1', 'reg1'].values * 2 |