MARIO
Multifunctional Assessment of Regions through Input-Output
Contents:
MARIO
Multifunctional Analysis of Regions through Input-Output. (Documents)
What is it
MARIO is a python package for handling input-output tables and models inspired by Pymrio . MARIO aims to provide a simple & intuitive API for common IO tasks without needing in-depth programming knowledge. MARIO supporst automatic parsing of different structured tables such EXIOBASE, EORA, EUROSTAT in different formats namely:
Single region
Multi region
Hybrid tables
Monetary tables
Input-Output tables
Supply-Use tables
When databases are not structured, MARIO supports parsing data from xlsx, csv, txt files or pandas.DataFrames.
More than parsing data, MARIO includes some basic functionalities:
Aggregation of databases
SUT to IOT transformation
- Modifying database in terms of adding:
New sectors, activities or commodities to the database
Adding new extensions to the satellite account
Scneario and shock analysis
Backward and forward linkages analysis
Extracting single region database from multi region databases
Balance test
Productivity test
Exporting the databases into different formats for scenarios analyzed
Interactive visualization routines
Requirements
MARIO has been tested on macOS and Windows.
To run MARIO, a couple of things are needed:
Being in love with Input-Output :-)
The Python programming language, version 3.7 or higher
A number of Python adds-on packages
For some functionalities a solver may needed (optional)
MARIO software itself
Recommended installation method
The easiest way to make MARIO software working is to use the free conda package manager which can install the current and future MARIO depencies in an easy and user friendly way.
To get conda, download and install “Anaconda Distribution” . Between differnet options for running python codes, we strongly suggest, Spyder, which is a free and open source scientific environment written in Python, for Python, and designed by and for scientists, engineers and data analysts.
You can install mario using pip or from source code. It is suggested to create a new environment by running the following command in the anaconda prompt
conda create -n mario python=3.8
If you create a new environment for mario, to use it, you need to activate the mario environment each time by writing the following line in Anaconda Prompt
conda activate mario
Now you can use pip to install mario on your environment as follow:
pip install mariopy
You can also install from the source code!
Quickstart
A simple test for Input-Output Table (IOT) and Supply-Use Table (SUT) is included in mario.
To use the IOT test, call
import mario
test_iot = mario.load_test('IOT')
and to use the SUT test, call
test_sut = mario.load_test('SUT')
To see the configurations of the data, you can print them:
print(test_iot)
print(test_sut)
To see specific sets of the tables like regions or value added, get_index function can be used:
print(test_iot.get_index('Region'))
print(test_sut.get_index('Factor of production'))
To visualize some data, various plot functions can be used:
test_iot.plot_matrix(....)
Specific modifications on the database can be done, such as SUT to IOT transformation:
reformed_iot = test.to_iot(method='B')
The changes can be tracked by metadata. The history can be checked by calling:
reformed_iot.meta_history
The new database can be saved into excel,txt or csv file:
reformed_iot.to_excel(path='a folder//database.xlsx')
Python module requirements
Some of the key packages the mario relies on are:
Testing MARIO
The current version of Mario has achieved a test coverage of 49%. This coverage includes a comprehensive 100% assessment of the fundamental mathematical engine. Additional tests are currently in active development to enhance the package’s reliability. Mario utilizes pytest as its primary tool for conducting unit tests. For a more detailed analysis of the test coverage pertaining to mario’s unit tests, you can execute the following command:
pytest --cov=mario tests/
Note
This project is under active development.
More examples will be uploaded through time to the gellery.
More parsers will be added to the next version.
The next version will cover some optimization models within the IO framework
For more tutorials on mario, check out our Input-Output analysis and modelling with MARIO Course
License

This work is licensed under a GNU GENERAL PUBLIC LICENSE
Download and installation
Requirements
MARIO has been tested on macOS and Windows.
To run MARIO, a couple of things are needed:
Being in love with Input-Output :-)
The Python programming language, version 3.7 or higher
A number of Python adds-on packages
For some functionalities a solver may needed (optional)
MARIO software itself
Recommended installation method
The easiest way to make MARIO software working is to use the free conda package manager which can install the current and future MARIO depencies in an easy and user friendly way.
To get conda, download and install “Anaconda Distribution” . Between differnet options for running python codes, we strongly suggest, Spyder, which is a free and open source scientific environment written in Python, for Python, and designed by and for scientists, engineers and data analysts.
You can install mario using pip or from source code. It is suggested to create a new environment by running the following command in the anaconda prompt
conda create -n mario python=3.8
If you create a new environment for mario, to use it, you need to activate the mario environment each time by writing the following line in Anaconda Prompt
conda activate mario
Now you can use pip to install mario on your environment as follow:
pip install mariopy
You can also install from the source code!
IMPORTANT NOTE: Pandas version 2.0 has recently been released, presenting major changes conflicting with MARIO. To overcome these issue, just install a previous version of Pandas as follows:
pip install pandas==1.3.5
Contributors
mario has been initally developed within SESAM group in the Department of Energy at Politecnico di Milano under the scientific coordination of Emanuela Colombo and Matteo Vincenzo Rocco. The research activity of SESAM focuses on the use of mathematical models for the study of systems and components in the energy field and industrial ecology.
mario has been used for some research projects within the group, and now is available as an open source code for the Input-Output modelling communities.
Communication, issues, bugs and contributions
We use github for tracking bugs, issues and suggestions related to mario. Any communications thorugh email are welcomed.
You may also follow us on social media like twitter or our official website to follow last news on mario or our research. We are looking forward for future communications and contributions.
Terminology
In the lack of consistent terminology for IO systems in the scientific community, MARIO uses its own customized variable names. MARIO follows a thermodynamic way of nomencluture which:
Uppercase letters represents Flows
Lowercase lettters represents Coefficients
Following table represents the variables and their explanations in MARIO:
variable name |
also known as |
extended name |
---|---|---|
Z |
T |
Intersectoral transaction flows matrix |
z |
A |
Intersectoral transaction coefficients matrix |
w |
L |
Leontief coefficient matrix |
Y |
F |
Final demand matrix |
X |
x, q, g |
Production vector |
V |
F |
Factor of production transaction flows matrix |
v |
f, B, S |
Factor of production transaction coefficients matrix |
E |
F, D_pba, terr |
Satellite transaction flows matrix |
U |
T |
Use transaction flow matrix |
u |
A |
Use coefficients matrix |
S |
V, M, T |
Supply transaction flow matrix |
s |
A |
Supply coefficients matrix |
EY |
S_Y, F_hh, F_y |
Satellite transaction flows matrix for final use |
M |
… |
Economic impact matrix |
m |
M |
Multipliers coefficient matrix |
F |
D_cba, con |
Footprint matrix |
e |
f, B, S |
Satellite transaction coefficients matrix |
f |
M |
Footprint coefficients matrix |
g |
G |
Gosh coefficients matrix |
b |
B |
Intersectoral transaction direct-output coefficients matrix |
p |
… |
Price index coefficients vector |
Handling databases
Exiobase3 parser
Parsing the exiobase data¶
In this example, parsing exiobase3, data search, slicing and bubble plots are examined.
from mario import parse_exiobase_3,slicer
# database path in local storage
path = r'IOT_2021_ixi.zip'
version = '3.8.1' # by defualt, version 3.8.2 will be parsed which there are minor differences
world = parse_exiobase_3(
path= path,
version= version,
)
# checking the regions and sectors
world.get_index('Region')
['AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GR', 'HR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK', 'GB', 'US', 'JP', 'CN', 'CA', 'KR', 'BR', 'IN', 'MX', 'RU', 'AU', 'CH', 'TR', 'TW', 'NO', 'ID', 'ZA', 'WA', 'WL', 'WE', 'WF', 'WM']
world.get_index('Sector')
['Cultivation of paddy rice', 'Cultivation of wheat', 'Cultivation of cereal grains nec', 'Cultivation of vegetables, fruit, nuts', 'Cultivation of oil seeds', 'Cultivation of sugar cane, sugar beet', 'Cultivation of plant-based fibers', 'Cultivation of crops nec', 'Cattle farming', 'Pigs farming', 'Poultry farming', 'Meat animals nec', 'Animal products nec', 'Raw milk', 'Wool, silk-worm cocoons', 'Manure treatment (conventional), storage and land application', 'Manure treatment (biogas), storage and land application', 'Forestry, logging and related service activities (02)', 'Fishing, operating of fish hatcheries and fish farms; service activities incidental to fishing (05)', 'Mining of coal and lignite; extraction of peat (10)', 'Extraction of crude petroleum and services related to crude oil extraction, excluding surveying', 'Extraction of natural gas and services related to natural gas extraction, excluding surveying', 'Extraction, liquefaction, and regasification of other petroleum and gaseous materials', 'Mining of uranium and thorium ores (12)', 'Mining of iron ores', 'Mining of copper ores and concentrates', 'Mining of nickel ores and concentrates', 'Mining of aluminium ores and concentrates', 'Mining of precious metal ores and concentrates', 'Mining of lead, zinc and tin ores and concentrates', 'Mining of other non-ferrous metal ores and concentrates', 'Quarrying of stone', 'Quarrying of sand and clay', 'Mining of chemical and fertilizer minerals, production of salt, other mining and quarrying n.e.c.', 'Processing of meat cattle', 'Processing of meat pigs', 'Processing of meat poultry', 'Production of meat products nec', 'Processing vegetable oils and fats', 'Processing of dairy products', 'Processed rice', 'Sugar refining', 'Processing of Food products nec', 'Manufacture of beverages', 'Manufacture of fish products', 'Manufacture of tobacco products (16)', 'Manufacture of textiles (17)', 'Manufacture of wearing apparel; dressing and dyeing of fur (18)', 'Tanning and dressing of leather; manufacture of luggage, handbags, saddlery, harness and footwear (19)', 'Manufacture of wood and of products of wood and cork, except furniture; manufacture of articles of straw and plaiting materials (20)', 'Re-processing of secondary wood material into new wood material', 'Pulp', 'Re-processing of secondary paper into new pulp', 'Paper', 'Publishing, printing and reproduction of recorded media (22)', 'Manufacture of coke oven products', 'Petroleum Refinery', 'Processing of nuclear fuel', 'Plastics, basic', 'Re-processing of secondary plastic into new plastic', 'N-fertiliser', 'P- and other fertiliser', 'Chemicals nec', 'Manufacture of rubber and plastic products (25)', 'Manufacture of glass and glass products', 'Re-processing of secondary glass into new glass', 'Manufacture of ceramic goods', 'Manufacture of bricks, tiles and construction products, in baked clay', 'Manufacture of cement, lime and plaster', 'Re-processing of ash into clinker', 'Manufacture of other non-metallic mineral products n.e.c.', 'Manufacture of basic iron and steel and of ferro-alloys and first products thereof', 'Re-processing of secondary steel into new steel', 'Precious metals production', 'Re-processing of secondary preciuos metals into new preciuos metals', 'Aluminium production', 'Re-processing of secondary aluminium into new aluminium', 'Lead, zinc and tin production', 'Re-processing of secondary lead into new lead, zinc and tin', 'Copper production', 'Re-processing of secondary copper into new copper', 'Other non-ferrous metal production', 'Re-processing of secondary other non-ferrous metals into new other non-ferrous metals', 'Casting of metals', 'Manufacture of fabricated metal products, except machinery and equipment (28)', 'Manufacture of machinery and equipment n.e.c. (29)', 'Manufacture of office machinery and computers (30)', 'Manufacture of electrical machinery and apparatus n.e.c. (31)', 'Manufacture of radio, television and communication equipment and apparatus (32)', 'Manufacture of medical, precision and optical instruments, watches and clocks (33)', 'Manufacture of motor vehicles, trailers and semi-trailers (34)', 'Manufacture of other transport equipment (35)', 'Manufacture of furniture; manufacturing n.e.c. (36)', 'Recycling of waste and scrap', 'Recycling of bottles by direct reuse', 'Production of electricity by coal', 'Production of electricity by gas', 'Production of electricity by nuclear', 'Production of electricity by hydro', 'Production of electricity by wind', 'Production of electricity by petroleum and other oil derivatives', 'Production of electricity by biomass and waste', 'Production of electricity by solar photovoltaic', 'Production of electricity by solar thermal', 'Production of electricity by tide, wave, ocean', 'Production of electricity by Geothermal', 'Production of electricity nec', 'Transmission of electricity', 'Distribution and trade of electricity', 'Manufacture of gas; distribution of gaseous fuels through mains', 'Steam and hot water supply', 'Collection, purification and distribution of water (41)', 'Construction (45)', 'Re-processing of secondary construction material into aggregates', 'Sale, maintenance, repair of motor vehicles, motor vehicles parts, motorcycles, motor cycles parts and accessoiries', 'Retail sale of automotive fuel', 'Wholesale trade and commission trade, except of motor vehicles and motorcycles (51)', 'Retail trade, except of motor vehicles and motorcycles; repair of personal and household goods (52)', 'Hotels and restaurants (55)', 'Transport via railways', 'Other land transport', 'Transport via pipelines', 'Sea and coastal water transport', 'Inland water transport', 'Air transport (62)', 'Supporting and auxiliary transport activities; activities of travel agencies (63)', 'Post and telecommunications (64)', 'Financial intermediation, except insurance and pension funding (65)', 'Insurance and pension funding, except compulsory social security (66)', 'Activities auxiliary to financial intermediation (67)', 'Real estate activities (70)', 'Renting of machinery and equipment without operator and of personal and household goods (71)', 'Computer and related activities (72)', 'Research and development (73)', 'Other business activities (74)', 'Public administration and defence; compulsory social security (75)', 'Education (80)', 'Health and social work (85)', 'Incineration of waste: Food', 'Incineration of waste: Paper', 'Incineration of waste: Plastic', 'Incineration of waste: Metals and Inert materials', 'Incineration of waste: Textiles', 'Incineration of waste: Wood', 'Incineration of waste: Oil/Hazardous waste', 'Biogasification of food waste, incl. land application', 'Biogasification of paper, incl. land application', 'Biogasification of sewage slugde, incl. land application', 'Composting of food waste, incl. land application', 'Composting of paper and wood, incl. land application', 'Waste water treatment, food', 'Waste water treatment, other', 'Landfill of waste: Food', 'Landfill of waste: Paper', 'Landfill of waste: Plastic', 'Landfill of waste: Inert/metal/hazardous', 'Landfill of waste: Textiles', 'Landfill of waste: Wood', 'Activities of membership organisation n.e.c. (91)', 'Recreational, cultural and sporting activities (92)', 'Other service activities (93)', 'Private households with employed persons (95)', 'Extra-territorial organizations and bodies']
# sliceing production matrix of the electricity sector for Italy using slicer and search funcition
# search
elect_sectors = world.search(item='Sector',search='electricity')
# printing what found with search
print(elect_sectors)
['Production of electricity by coal', 'Production of electricity by gas', 'Production of electricity by nuclear', 'Production of electricity by hydro', 'Production of electricity by wind', 'Production of electricity by petroleum and other oil derivatives', 'Production of electricity by biomass and waste', 'Production of electricity by solar photovoltaic', 'Production of electricity by solar thermal', 'Production of electricity by tide, wave, ocean', 'Production of electricity by Geothermal', 'Production of electricity nec', 'Transmission of electricity', 'Distribution and trade of electricity']
# using slicer to slice data
X_rows = slicer(matrix='X',axis=0,Region=['IT'],Item=elect_sectors)
# printing the sliced matrix
world.X.loc[X_rows]
Item | production | ||
---|---|---|---|
Region | Level | Item | |
IT | Sector | Production of electricity by coal | 4831.897152 |
Production of electricity by gas | 28735.410379 | ||
Production of electricity by nuclear | 0.000000 | ||
Production of electricity by hydro | 4376.940447 | ||
Production of electricity by wind | 610.870356 | ||
Production of electricity by petroleum and other oil derivatives | 4199.878133 | ||
Production of electricity by biomass and waste | 845.105678 | ||
Production of electricity by solar photovoltaic | 23.392909 | ||
Production of electricity by solar thermal | 0.000018 | ||
Production of electricity by tide, wave, ocean | 0.000000 | ||
Production of electricity by Geothermal | 693.535091 | ||
Production of electricity nec | 849.541757 | ||
Transmission of electricity | 2346.687155 | ||
Distribution and trade of electricity | 33553.869719 |
# aggregating the database
aggregation_path = r'aggregation.xlsx'
world.aggregate(io=aggregation_path)
# getting the footprints
world.F.head()
Database: to calculate F following matrices are need. ['f'].Trying to calculate dependencies. Database: to calculate f following matrices are need. ['w'].Trying to calculate dependencies.
Austria | ... | RoW Middle East | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Level | Sector | ... | Sector | ||||||||||||||||||
Agriculture, hunting, forestry & fishing | Mining & quarrying | Food production, beverages & tobacco | Textiles, leather & wearing apparel | Wood, paper & publishing | Petroleum, chemicals & non-metallic mineral products | Metal & metal products | Electrical & machinery | Transport equipment | Manufacturing & recycling | ... | Electrical & machinery | Transport equipment | Manufacturing & recycling | Electricity, gas & water | Construction | Sale, maintenance & repair of vehicles; fuel; trade; hotels & restaurants | Transport | Post & telecommunications | Financial intermediation & business activity | Public administration; education; health; recreation; other services | |
Employment | 1.331527e+02 | 6.997435e+00 | 4.404540e+02 | 7.845184e+01 | 1.833696e+02 | 4.431709e+02 | 1.193802e+02 | 4.558817e+02 | 2.796197e+02 | 1.364980e+02 | ... | 3.251189e+03 | 2.031831e+03 | 7.607130e+02 | 6.347465e+02 | 1.099505e+04 | 3.653973e+03 | 1.756642e+03 | 7.731014e+02 | 6.567751e+03 | 1.697093e+04 |
CO2 | 7.708017e+08 | 4.002476e+08 | 3.731830e+09 | 7.530532e+08 | 2.672895e+09 | 5.530164e+09 | 1.844712e+09 | 4.445331e+09 | 2.834330e+09 | 9.442130e+08 | ... | 5.786528e+10 | 3.081228e+10 | 7.764390e+10 | 3.033634e+11 | 2.518542e+11 | 4.635415e+10 | 1.104342e+11 | 1.078153e+10 | 1.420117e+11 | 2.893499e+11 |
Water Consumption Blue | 6.928835e+01 | 9.781189e-01 | 1.392947e+02 | 2.125195e+01 | 4.200118e+01 | 6.661183e+01 | 3.185083e+01 | 5.436348e+01 | 3.928244e+01 | 1.506007e+01 | ... | 1.596469e+03 | 8.461922e+02 | 1.491153e+03 | 8.193925e+02 | 9.865392e+03 | 4.948024e+03 | 1.292466e+03 | 3.264725e+02 | 4.323316e+03 | 1.338667e+04 |
Energy | 2.059056e+04 | 5.690671e+03 | 8.593959e+04 | 1.562560e+04 | 8.463720e+04 | 1.341560e+05 | 3.515236e+04 | 8.954767e+04 | 5.595756e+04 | 1.966528e+04 | ... | 9.347209e+05 | 5.129471e+05 | 1.251166e+06 | 3.504441e+06 | 4.472632e+06 | 7.526524e+05 | 1.578120e+06 | 1.746873e+05 | 2.265513e+06 | 4.758775e+06 |
4 rows × 833 columns
# using bubble plot for visualization
world.plot_bubble(x='CO2', y='Employment', size='GDP',path='bubble_plot.html')
EORA parser
EORA26¶
import mario
import pandas as pd
folder_path = r'eora_files'
database_file = 'Eora26_2015_bp.zip'
indeces_file = 'indeces.zip'
world= mario.parse_eora(
path= rf'{folder_path}\{database_file}',
indeces= rf'{folder_path}\{indeces_file}',
multi_region= True,
year= 2015, # year of the datbase file
)
Parser; Deleting `ROW` from database due to inconsistency in the datbase and will be added to Z and Y matrix. C:\Users\payam\anaconda3\lib\site-packages\pandas\core\generic.py:4150: PerformanceWarning: dropping on a non-lexsorted multi-index without a level parameter may impact performance. C:\Users\payam\anaconda3\lib\site-packages\IPython\core\async_helpers.py:68: PerformanceWarning: indexing past lexsort depth may impact performance.
# Due to some inconsistency in database, some changes are implemenetd and recorded in metadata
world.meta_history
[13:13:56] Table added into metadata with value equal to IOT. [13:13:56] Price added into metadata with value equal to None. [13:13:56] Source added into metadata with value equal to Eora website @ https://www.worldmrio.com/. [13:13:56] Year added into metadata with value equal to 2015. [13:13:56] ROW deleted from database due to inconsistency. [13:13:56] Intermediate imports from ROW added to VA matrix [13:13:56] Intermediate exports to ROW added to Y matrix [13:13:56] Database successfully imported. [13:13:56] Number of Region = 189 [13:13:56] Number of Consumption category = 7 [13:13:56] Number of Satellite account = 2631 [13:13:56] Number of Factor of production = 7 [13:13:56] Number of Sector = 26
# checking if the datbase is balanced
world.is_balanced(
method= 'coefficients', # checking based on the coefficients method
margin= 0.3, # considering a margin of 0.5 (1.3 & 0.7) are considered as balanced
)
+----------------------------------------------------------------------------+---------------+ | | v+z | |----------------------------------------------------------------------------+---------------| | ('AFG', 'Sector', 'Re-export & Re-import') | 0.590342 | | ('ALB', 'Sector', 'Fishing') | 0.576508 | | ('ALB', 'Sector', 'Mining and Quarrying') | 0.235763 | | ('ALB', 'Sector', 'Hotels and Restraurants') | 0.536803 | | ('ALB', 'Sector', 'Transport') | 0.307692 | | ('ALB', 'Sector', 'Re-export & Re-import') | 0.683264 | | ('DZA', 'Sector', 'Re-export & Re-import') | 2.51327 | | ('AND', 'Sector', 'Fishing') | 0.547632 | | ('AND', 'Sector', 'Mining and Quarrying') | 0.501519 | | ('AND', 'Sector', 'Recycling') | 0.637035 | | ('AND', 'Sector', 'Transport') | 0.673593 | | ('AND', 'Sector', 'Re-export & Re-import') | 0.348236 | | ('AGO', 'Sector', 'Re-export & Re-import') | 0.420958 | | ('ATG', 'Sector', 'Fishing') | 1.61682 | | ('ATG', 'Sector', 'Mining and Quarrying') | 0.519493 | | ('ATG', 'Sector', 'Transport') | 0.573321 | | ('ATG', 'Sector', 'Re-export & Re-import') | 0.487125 | | ('ARG', 'Sector', 'Fishing') | 3.01443 | | ('ARG', 'Sector', 'Recycling') | 1.67963 | | ('ARM', 'Sector', 'Fishing') | 1.49406 | | ('ARM', 'Sector', 'Others') | 1.35824 | | ('ARM', 'Sector', 'Re-export & Re-import') | 0.531058 | | ('ABW', 'Sector', 'Agriculture') | 2.47029 | | ('ABW', 'Sector', 'Fishing') | 5.07896 | | ('ABW', 'Sector', 'Metal Products') | 1.30536 | | ('ABW', 'Sector', 'Recycling') | 0.665874 | | ('ABW', 'Sector', 'Others') | 1.92533 | | ('AUS', 'Sector', 'Electrical and Machinery') | 0.688453 | | ('AUS', 'Sector', 'Recycling') | 0.593457 | | ('AUS', 'Sector', 'Maintenance and Repair') | 1.48859 | | ('AUS', 'Sector', 'Wholesale Trade') | 1.56849 | | ('AUS', 'Sector', 'Retail Trade') | 1.4166 | | ('AUS', 'Sector', 'Others') | 1.46309 | | ('AUT', 'Sector', 'Fishing') | 2.79482 | | ('BHS', 'Sector', 'Re-export & Re-import') | 0.588265 | | ('BGD', 'Sector', 'Re-export & Re-import') | 1.34102 | | ('BRB', 'Sector', 'Agriculture') | 0.589933 | | ('BRB', 'Sector', 'Fishing') | 0.633125 | | ('BRB', 'Sector', 'Mining and Quarrying') | 0.303341 | | ('BRB', 'Sector', 'Hotels and Restraurants') | 0.680038 | | ('BRB', 'Sector', 'Transport') | 0.461713 | | ('BRB', 'Sector', 'Re-export & Re-import') | 0.566191 | | ('BLR', 'Sector', 'Agriculture') | 26.1626 | | ('BLR', 'Sector', 'Fishing') | 4.3086 | | ('BLR', 'Sector', 'Mining and Quarrying') | 6.47721 | | ('BLR', 'Sector', 'Petroleum, Chemical and Non-Metallic Mineral Products') | 1.50353 | | ('BLR', 'Sector', 'Electrical and Machinery') | 1.53116 | | ('BLR', 'Sector', 'Transport Equipment') | 1.43127 | | ('BLR', 'Sector', 'Other Manufacturing') | 1.4499 | | ('BLR', 'Sector', 'Recycling') | 1.39854 | | ('BLR', 'Sector', 'Electricity, Gas and Water') | 5.55462 | | ('BLR', 'Sector', 'Construction') | 23.5242 | | ('BLR', 'Sector', 'Maintenance and Repair') | 1.80888 | | ('BLR', 'Sector', 'Wholesale Trade') | 9.48142 | | ('BLR', 'Sector', 'Retail Trade') | 1.79555 | | ('BLR', 'Sector', 'Hotels and Restraurants') | 2.70256 | | ('BLR', 'Sector', 'Transport') | 1.41897 | | ('BLR', 'Sector', 'Post and Telecommunications') | 1.42849 | | ('BLR', 'Sector', 'Finacial Intermediation and Business Activities') | 6.50146 | | ('BLR', 'Sector', 'Public Administration') | 4.86391 | | ('BLR', 'Sector', 'Education, Health and Other Services') | 13.3894 | | ('BLR', 'Sector', 'Private Households') | 1.8817 | | ('BLR', 'Sector', 'Others') | 2.47183 | | ('BLR', 'Sector', 'Re-export & Re-import') | 12.344 | | ('BEL', 'Sector', 'Mining and Quarrying') | 0.395648 | | ('BEL', 'Sector', 'Recycling') | 142.209 | | ('BEL', 'Sector', 'Retail Trade') | 1.38805 | | ('BLZ', 'Sector', 'Mining and Quarrying') | 0.6132 | | ('BLZ', 'Sector', 'Recycling') | 0.693102 | | ('BLZ', 'Sector', 'Transport') | 0.555702 | | ('BLZ', 'Sector', 'Re-export & Re-import') | 0.440904 | | ('BEN', 'Sector', 'Mining and Quarrying') | 0.367488 | | ('BEN', 'Sector', 'Transport') | 0.585462 | | ('BMU', 'Sector', 'Recycling') | 0.688222 | | ('BMU', 'Sector', 'Re-export & Re-import') | 0.594837 | | ('BTN', 'Sector', 'Fishing') | 2.07803 | | ('BOL', 'Sector', 'Re-export & Re-import') | 0.293407 | | ('BIH', 'Sector', 'Fishing') | 0.451499 | | ('BIH', 'Sector', 'Mining and Quarrying') | 0.370087 | | ('BIH', 'Sector', 'Hotels and Restraurants') | 0.677651 | | ('BIH', 'Sector', 'Transport') | 0.458951 | | ('BIH', 'Sector', 'Re-export & Re-import') | 0.686649 | | ('BWA', 'Sector', 'Fishing') | 0.698791 | | ('BWA', 'Sector', 'Re-export & Re-import') | 0.535392 | | ('BRA', 'Sector', 'Fishing') | 8.67084 | | ('BRA', 'Sector', 'Recycling') | 11.3354 | | ('BRA', 'Sector', 'Private Households') | 0.0124887 | | ('BRA', 'Sector', 'Others') | 2.03962 | | ('VGB', 'Sector', 'Re-export & Re-import') | 0.510268 | | ('BRN', 'Sector', 'Re-export & Re-import') | 0.655047 | | ('BGR', 'Sector', 'Fishing') | 0.690627 | | ('BFA', 'Sector', 'Re-export & Re-import') | 1.93293 | | ('BDI', 'Sector', 'Fishing') | 2.66292 | | ('BDI', 'Sector', 'Transport') | 0.609811 | | ('BDI', 'Sector', 'Re-export & Re-import') | 0.536804 | | ('KHM', 'Sector', 'Mining and Quarrying') | 0.623751 | | ('KHM', 'Sector', 'Re-export & Re-import') | 0.562384 | | ('CMR', 'Sector', 'Fishing') | 0.626247 | | ('CMR', 'Sector', 'Mining and Quarrying') | 0.581452 | | ('CMR', 'Sector', 'Transport') | 0.61701 | | ('CPV', 'Sector', 'Fishing') | 1.6729 | | ('CPV', 'Sector', 'Mining and Quarrying') | 0.535754 | | ('CPV', 'Sector', 'Recycling') | 0.693308 | | ('CPV', 'Sector', 'Re-export & Re-import') | 0.457244 | | ('CYM', 'Sector', 'Fishing') | 1.60682 | | ('CYM', 'Sector', 'Re-export & Re-import') | 0.327857 | | ('CAF', 'Sector', 'Fishing') | 1.89616 | | ('CAF', 'Sector', 'Mining and Quarrying') | 0.508542 | | ('CAF', 'Sector', 'Transport') | 0.549888 | | ('CAF', 'Sector', 'Re-export & Re-import') | 0.57596 | | ('TCD', 'Sector', 'Fishing') | 1.56801 | | ('TCD', 'Sector', 'Mining and Quarrying') | 0.595288 | | ('TCD', 'Sector', 'Transport') | 0.652937 | | ('TCD', 'Sector', 'Re-export & Re-import') | 0.473825 | | ('CHL', 'Sector', 'Recycling') | 0.684945 | | ('CHL', 'Sector', 'Private Households') | 0.2133 | | ('CHL', 'Sector', 'Others') | 4607.15 | | ('CHN', 'Sector', 'Re-export & Re-import') | 2.46449 | | ('COL', 'Sector', 'Agriculture') | 4.34253 | | ('COL', 'Sector', 'Mining and Quarrying') | 1.49347 | | ('COL', 'Sector', 'Food & Beverages') | 0.688632 | | ('COL', 'Sector', 'Wood and Paper') | 1.65472 | | ('COL', 'Sector', 'Petroleum, Chemical and Non-Metallic Mineral Products') | 1.33113 | | ('COL', 'Sector', 'Electrical and Machinery') | 0.439157 | | ('COL', 'Sector', 'Transport Equipment') | 0.636815 | | ('COL', 'Sector', 'Recycling') | 0.361296 | | ('COL', 'Sector', 'Construction') | 0.135239 | | ('COL', 'Sector', 'Maintenance and Repair') | 15.5235 | | ('COL', 'Sector', 'Wholesale Trade') | 15.5235 | | ('COL', 'Sector', 'Retail Trade') | 15.5235 | | ('COL', 'Sector', 'Hotels and Restraurants') | 0.463457 | | ('COL', 'Sector', 'Transport') | 0.455102 | | ('COL', 'Sector', 'Finacial Intermediation and Business Activities') | 0.245587 | | ('COL', 'Sector', 'Public Administration') | 2.301 | | ('COL', 'Sector', 'Education, Health and Other Services') | 0.612844 | | ('COL', 'Sector', 'Others') | 2.51595 | | ('COL', 'Sector', 'Re-export & Re-import') | 1.64535 | | ('COG', 'Sector', 'Re-export & Re-import') | 0.673128 | | ('CRI', 'Sector', 'Re-export & Re-import') | 1.3522 | | ('HRV', 'Sector', 'Fishing') | 0.618804 | | ('HRV', 'Sector', 'Mining and Quarrying') | 0.645799 | | ('HRV', 'Sector', 'Transport') | 0.644042 | | ('CUB', 'Sector', 'Fishing') | 0.41038 | | ('CUB', 'Sector', 'Mining and Quarrying') | 0.572574 | | ('CYP', 'Sector', 'Fishing') | 0.493851 | | ('CYP', 'Sector', 'Mining and Quarrying') | 0.563142 | | ('CYP', 'Sector', 'Transport') | 0.652525 | | ('CYP', 'Sector', 'Re-export & Re-import') | 0.346601 | | ('CZE', 'Sector', 'Private Households') | 1.53677 | | ('CZE', 'Sector', 'Re-export & Re-import') | 0.225994 | | ('CIV', 'Sector', 'Mining and Quarrying') | 0.671006 | | ('CIV', 'Sector', 'Re-export & Re-import') | 0.638763 | | ('PRK', 'Sector', 'Re-export & Re-import') | 0.337202 | | ('COD', 'Sector', 'Re-export & Re-import') | 0.395185 | | ('DJI', 'Sector', 'Fishing') | 2.07902 | | ('DJI', 'Sector', 'Mining and Quarrying') | 0.464522 | | ('DJI', 'Sector', 'Hotels and Restraurants') | 0.675304 | | ('DJI', 'Sector', 'Transport') | 0.60458 | | ('DJI', 'Sector', 'Re-export & Re-import') | 0.425403 | | ('DOM', 'Sector', 'Fishing') | 0.501049 | | ('DOM', 'Sector', 'Re-export & Re-import') | 1.75834 | | ('ECU', 'Sector', 'Wood and Paper') | 1.71767 | | ('ECU', 'Sector', 'Other Manufacturing') | 0.0858897 | | ('ECU', 'Sector', 'Recycling') | 0.0858898 | | ('ECU', 'Sector', 'Re-export & Re-import') | 0.392069 | | ('EGY', 'Sector', 'Re-export & Re-import') | 3.53006 | | ('SLV', 'Sector', 'Fishing') | 0.5791 | | ('SLV', 'Sector', 'Mining and Quarrying') | 0.619338 | | ('SLV', 'Sector', 'Re-export & Re-import') | 0.339895 | | ('ERI', 'Sector', 'Fishing') | 2.15267 | | ('ERI', 'Sector', 'Mining and Quarrying') | 0.379123 | | ('ERI', 'Sector', 'Transport') | 0.62978 | | ('ERI', 'Sector', 'Re-export & Re-import') | 0.425214 | | ('EST', 'Sector', 'Recycling') | 3.81724 | | ('EST', 'Sector', 'Private Households') | 1.72198 | | ('ETH', 'Sector', 'Agriculture') | 3.86677 | | ('ETH', 'Sector', 'Fishing') | 59.283 | | ('ETH', 'Sector', 'Mining and Quarrying') | 7.03749 | | ('ETH', 'Sector', 'Food & Beverages') | 4.38696 | | ('ETH', 'Sector', 'Textiles and Wearing Apparel') | 4.39306 | | ('ETH', 'Sector', 'Wood and Paper') | 16.6021 | | ('ETH', 'Sector', 'Petroleum, Chemical and Non-Metallic Mineral Products') | 7.92316 | | ('ETH', 'Sector', 'Metal Products') | 11.3346 | | ('ETH', 'Sector', 'Electrical and Machinery') | 4.69687 | | ('ETH', 'Sector', 'Transport Equipment') | 10.391 | | ('ETH', 'Sector', 'Other Manufacturing') | 14.8769 | | ('ETH', 'Sector', 'Recycling') | 14.391 | | ('ETH', 'Sector', 'Electricity, Gas and Water') | 9.30984 | | ('ETH', 'Sector', 'Construction') | 6.54581 | | ('ETH', 'Sector', 'Maintenance and Repair') | 12.5854 | | ('ETH', 'Sector', 'Wholesale Trade') | 7.3907 | | ('ETH', 'Sector', 'Retail Trade') | 11.0661 | | ('ETH', 'Sector', 'Hotels and Restraurants') | 8.0149 | | ('ETH', 'Sector', 'Transport') | 4.26697 | | ('ETH', 'Sector', 'Post and Telecommunications') | 6.14041 | | ('ETH', 'Sector', 'Finacial Intermediation and Business Activities') | 6.74409 | | ('ETH', 'Sector', 'Public Administration') | 8.33629 | | ('ETH', 'Sector', 'Education, Health and Other Services') | 8.08222 | | ('ETH', 'Sector', 'Private Households') | 14.9176 | | ('ETH', 'Sector', 'Others') | 16.7393 | | ('ETH', 'Sector', 'Re-export & Re-import') | 2.0456 | | ('FJI', 'Sector', 'Fishing') | 0.595422 | | ('FJI', 'Sector', 'Mining and Quarrying') | 0.28553 | | ('FJI', 'Sector', 'Hotels and Restraurants') | 0.667253 | | ('FJI', 'Sector', 'Transport') | 0.507693 | | ('FJI', 'Sector', 'Re-export & Re-import') | 0.572823 | | ('FIN', 'Sector', 'Recycling') | 5.27798 | | ('FRA', 'Sector', 'Recycling') | 120.021 | | ('PYF', 'Sector', 'Mining and Quarrying') | 0.524065 | | ('PYF', 'Sector', 'Transport') | 0.665538 | | ('PYF', 'Sector', 'Re-export & Re-import') | 0.557539 | | ('GAB', 'Sector', 'Fishing') | 0.614878 | | ('GAB', 'Sector', 'Mining and Quarrying') | 0.664597 | | ('GAB', 'Sector', 'Transport') | 0.564642 | | ('GMB', 'Sector', 'Fishing') | 1.51396 | | ('GMB', 'Sector', 'Recycling') | 0.461423 | | ('GMB', 'Sector', 'Private Households') | 0.47602 | | ('GMB', 'Sector', 'Others') | 0.589492 | | ('GMB', 'Sector', 'Re-export & Re-import') | 0.408144 | | ('GEO', 'Sector', 'Food & Beverages') | 0.528209 | | ('GEO', 'Sector', 'Textiles and Wearing Apparel') | 2.47203 | | ('GEO', 'Sector', 'Wood and Paper') | 0.26593 | | ('GEO', 'Sector', 'Transport Equipment') | 0.164004 | | ('GEO', 'Sector', 'Other Manufacturing') | 2.45257 | | ('GEO', 'Sector', 'Recycling') | 2.45257 | | ('GEO', 'Sector', 'Wholesale Trade') | 1.99976 | | ('GEO', 'Sector', 'Private Households') | 85.5445 | | ('GEO', 'Sector', 'Re-export & Re-import') | 0.607937 | | ('GHA', 'Sector', 'Fishing') | 0.696141 | | ('GHA', 'Sector', 'Mining and Quarrying') | 0.590392 | | ('GRL', 'Sector', 'Wood and Paper') | 1.51129 | | ('GRL', 'Sector', 'Petroleum, Chemical and Non-Metallic Mineral Products') | 2.34985 | | ('GRL', 'Sector', 'Metal Products') | 1.52126 | | ('GRL', 'Sector', 'Electrical and Machinery') | 1.52126 | | ('GRL', 'Sector', 'Transport Equipment') | 1.52127 | | ('GRL', 'Sector', 'Other Manufacturing') | 1.52127 | | ('GRL', 'Sector', 'Recycling') | 1.52127 | | ('GTM', 'Sector', 'Re-export & Re-import') | 1.35603 | | ('GIN', 'Sector', 'Transport') | 0.588065 | | ('GIN', 'Sector', 'Re-export & Re-import') | 0.679896 | | ('GUY', 'Sector', 'Agriculture') | 0.58075 | | ('GUY', 'Sector', 'Fishing') | 0.366339 | | ('GUY', 'Sector', 'Mining and Quarrying') | 0.420226 | | ('GUY', 'Sector', 'Re-export & Re-import') | -0.116821 | | ('HTI', 'Sector', 'Mining and Quarrying') | 0.564972 | | ('HTI', 'Sector', 'Re-export & Re-import') | 0.695746 | | ('HKG', 'Sector', 'Re-export & Re-import') | 0.565741 | | ('HUN', 'Sector', 'Private Households') | 1.55957 | | ('ISL', 'Sector', 'Mining and Quarrying') | 0.373392 | | ('ISL', 'Sector', 'Hotels and Restraurants') | 0.609355 | | ('ISL', 'Sector', 'Re-export & Re-import') | 0.639594 | | ('IND', 'Sector', 'Textiles and Wearing Apparel') | 1.30381 | | ('IND', 'Sector', 'Private Households') | 0.506093 | | ('IND', 'Sector', 'Others') | 0.506092 | | ('IND', 'Sector', 'Re-export & Re-import') | 1.53377 | | ('IRN', 'Sector', 'Fishing') | 1.81153 | | ('IRN', 'Sector', 'Mining and Quarrying') | 1.53436 | | ('IRN', 'Sector', 'Textiles and Wearing Apparel') | 1.80418 | | ('IRN', 'Sector', 'Wood and Paper') | 2.32137 | | ('IRN', 'Sector', 'Petroleum, Chemical and Non-Metallic Mineral Products') | 0.347997 | | ('IRN', 'Sector', 'Metal Products') | 1.98487 | | ('IRN', 'Sector', 'Transport Equipment') | 0.54668 | | ('IRN', 'Sector', 'Other Manufacturing') | 1.80694 | | ('IRN', 'Sector', 'Recycling') | 3.79461 | | ('IRN', 'Sector', 'Electricity, Gas and Water') | 7.28841 | | ('IRN', 'Sector', 'Construction') | 0.213668 | | ('IRN', 'Sector', 'Maintenance and Repair') | 0.633852 | | ('IRN', 'Sector', 'Wholesale Trade') | 0.633852 | | ('IRN', 'Sector', 'Retail Trade') | 0.633852 | | ('IRN', 'Sector', 'Hotels and Restraurants') | 1.85438 | | ('IRN', 'Sector', 'Post and Telecommunications') | 2.20241 | | ('IRN', 'Sector', 'Finacial Intermediation and Business Activities') | 0.663701 | | ('IRN', 'Sector', 'Public Administration') | 1.59376 | | ('IRN', 'Sector', 'Education, Health and Other Services') | 1.64055 | | ('IRN', 'Sector', 'Private Households') | 9.73685 | | ('IRN', 'Sector', 'Others') | 9.73686 | | ('IRN', 'Sector', 'Re-export & Re-import') | 0.555862 | | ('IRL', 'Sector', 'Other Manufacturing') | 0.688124 | | ('ISR', 'Sector', 'Re-export & Re-import') | 20.0482 | | ('ITA', 'Sector', 'Re-export & Re-import') | 1.38054 | | ('JPN', 'Sector', 'Re-export & Re-import') | 0.153804 | | ('KAZ', 'Sector', 'Re-export & Re-import') | 0.481204 | | ('KWT', 'Sector', 'Private Households') | 1.82015 | | ('KWT', 'Sector', 'Re-export & Re-import') | 3.30106 | | ('KGZ', 'Sector', 'Fishing') | 4.80647 | | ('KGZ', 'Sector', 'Wood and Paper') | 0.681305 | | ('KGZ', 'Sector', 'Petroleum, Chemical and Non-Metallic Mineral Products') | 0.61834 | | ('KGZ', 'Sector', 'Maintenance and Repair') | 12.511 | | ('KGZ', 'Sector', 'Wholesale Trade') | 6.25691 | | ('KGZ', 'Sector', 'Retail Trade') | 14.2979 | | ('KGZ', 'Sector', 'Private Households') | 0.562898 | | ('KGZ', 'Sector', 'Others') | 0.562898 | | ('LAO', 'Sector', 'Re-export & Re-import') | 0.482284 | | ('LVA', 'Sector', 'Hotels and Restraurants') | 0.63953 | | ('LVA', 'Sector', 'Private Households') | 0.462012 | | ('LVA', 'Sector', 'Re-export & Re-import') | 2.14564 | | ('LBN', 'Sector', 'Fishing') | 0.678848 | | ('LBN', 'Sector', 'Mining and Quarrying') | 0.557127 | | ('LBR', 'Sector', 'Fishing') | 1.32923 | | ('LBR', 'Sector', 'Mining and Quarrying') | 0.381612 | | ('LBR', 'Sector', 'Textiles and Wearing Apparel') | 0.667472 | | ('LBR', 'Sector', 'Other Manufacturing') | 0.682866 | | ('LBR', 'Sector', 'Recycling') | 0.425856 | | ('LBR', 'Sector', 'Maintenance and Repair') | 0.539178 | | ('LBR', 'Sector', 'Hotels and Restraurants') | 0.679329 | | ('LBR', 'Sector', 'Transport') | 0.505332 | | ('LBR', 'Sector', 'Private Households') | 0.449195 | | ('LBR', 'Sector', 'Others') | 0.527347 | | ('LBR', 'Sector', 'Re-export & Re-import') | 0.473632 | | ('LTU', 'Sector', 'Agriculture') | 1.37448 | | ('LTU', 'Sector', 'Fishing') | 0.687091 | | ('LUX', 'Sector', 'Fishing') | 3.80894 | | ('LUX', 'Sector', 'Recycling') | 2.46661 | | ('MAC', 'Sector', 'Agriculture') | 0.61849 | | ('MAC', 'Sector', 'Fishing') | -1.78692 | | ('MAC', 'Sector', 'Mining and Quarrying') | 0.176629 | | ('MAC', 'Sector', 'Transport') | 0.577197 | | ('MAC', 'Sector', 'Re-export & Re-import') | 0.441478 | | ('MDG', 'Sector', 'Mining and Quarrying') | 0.406378 | | ('MDG', 'Sector', 'Transport') | 0.647738 | | ('MDG', 'Sector', 'Re-export & Re-import') | 0.676545 | | ('MWI', 'Sector', 'Mining and Quarrying') | 0.695759 | | ('MWI', 'Sector', 'Re-export & Re-import') | 0.409779 | | ('MYS', 'Sector', 'Others') | 4.35267 | | ('MDV', 'Sector', 'Recycling') | 0.447194 | | ('MDV', 'Sector', 'Private Households') | 0.513603 | | ('MDV', 'Sector', 'Re-export & Re-import') | 0.28436 | | ('MLI', 'Sector', 'Mining and Quarrying') | 0.456377 | | ('MLI', 'Sector', 'Transport') | 0.566504 | | ('MLI', 'Sector', 'Re-export & Re-import') | 0.691964 | | ('MLT', 'Sector', 'Re-export & Re-import') | 0.38238 | | ('MRT', 'Sector', 'Recycling') | 0.619361 | | ('MRT', 'Sector', 'Re-export & Re-import') | 0.560833 | | ('MUS', 'Sector', 'Mining and Quarrying') | 0.208138 | | ('MUS', 'Sector', 'Electrical and Machinery') | 0.473155 | | ('MUS', 'Sector', 'Transport Equipment') | 0.259332 | | ('MUS', 'Sector', 'Other Manufacturing') | 1.32327 | | ('MUS', 'Sector', 'Recycling') | 13.3532 | | ('MUS', 'Sector', 'Maintenance and Repair') | 1.45386 | | ('MUS', 'Sector', 'Wholesale Trade') | 0.427225 | | ('MUS', 'Sector', 'Retail Trade') | 4.63867 | | ('MUS', 'Sector', 'Private Households') | 0.00591609 | | ('MUS', 'Sector', 'Others') | 70.9943 | | ('MUS', 'Sector', 'Re-export & Re-import') | 0.59649 | | ('MEX', 'Sector', 'Re-export & Re-import') | 1.51827 | | ('MCO', 'Sector', 'Fishing') | 0.538732 | | ('MCO', 'Sector', 'Recycling') | 0.659676 | | ('MCO', 'Sector', 'Re-export & Re-import') | 0.537505 | | ('MNE', 'Sector', 'Mining and Quarrying') | 0.551087 | | ('MNE', 'Sector', 'Transport') | 0.502927 | | ('MNE', 'Sector', 'Re-export & Re-import') | 1.62757 | | ('MAR', 'Sector', 'Re-export & Re-import') | 2.65221 | | ('MMR', 'Sector', 'Re-export & Re-import') | 1.48084 | | ('NAM', 'Sector', 'Re-export & Re-import') | 0.631566 | | ('NPL', 'Sector', 'Mining and Quarrying') | 0.670537 | | ('NLD', 'Sector', 'Fishing') | 1.36043 | | ('NLD', 'Sector', 'Other Manufacturing') | 1.32701 | | ('NLD', 'Sector', 'Recycling') | 1.44051 | | ('NLD', 'Sector', 'Others') | 0.643124 | | ('ANT', 'Sector', 'Mining and Quarrying') | 0.225796 | | ('ANT', 'Sector', 'Food & Beverages') | 0.394789 | | ('ANT', 'Sector', 'Textiles and Wearing Apparel') | 7.3702 | | ('ANT', 'Sector', 'Wood and Paper') | 7.61004 | | ('ANT', 'Sector', 'Petroleum, Chemical and Non-Metallic Mineral Products') | 0.535109 | | ('ANT', 'Sector', 'Electrical and Machinery') | 1.39447 | | ('ANT', 'Sector', 'Transport Equipment') | 0.37488 | | ('ANT', 'Sector', 'Other Manufacturing') | 1.45639 | | ('ANT', 'Sector', 'Recycling') | 1.45639 | | ('ANT', 'Sector', 'Post and Telecommunications') | 0.566629 | | ('ANT', 'Sector', 'Education, Health and Other Services') | 1.33039 | | ('ANT', 'Sector', 'Private Households') | 0.626495 | | ('ANT', 'Sector', 'Others') | 0.183568 | | ('ANT', 'Sector', 'Re-export & Re-import') | 1.59547 | | ('NCL', 'Sector', 'Re-export & Re-import') | 0.650205 | | ('NZL', 'Sector', 'Recycling') | 10.0595 | | ('NZL', 'Sector', 'Maintenance and Repair') | 1.72052 | | ('NZL', 'Sector', 'Wholesale Trade') | 1.67256 | | ('NZL', 'Sector', 'Retail Trade') | 1.77523 | | ('NIC', 'Sector', 'Re-export & Re-import') | 0.545079 | | ('NER', 'Sector', 'Fishing') | 1.31383 | | ('NER', 'Sector', 'Recycling') | 0.694501 | | ('NGA', 'Sector', 'Re-export & Re-import') | 2.85641 | | ('NOR', 'Sector', 'Recycling') | 1.30914 | | ('PSE', 'Sector', 'Mining and Quarrying') | 0.624775 | | ('OMN', 'Sector', 'Re-export & Re-import') | 1.32125 | | ('PAK', 'Sector', 'Re-export & Re-import') | 2.37949 | | ('PNG', 'Sector', 'Re-export & Re-import') | 0.687337 | | ('PRY', 'Sector', 'Metal Products') | 0.498559 | | ('PRY', 'Sector', 'Electrical and Machinery') | 3.10287 | | ('PRY', 'Sector', 'Transport Equipment') | 0.248097 | | ('PRY', 'Sector', 'Transport') | 0.632701 | | ('PRY', 'Sector', 'Re-export & Re-import') | 2.03593 | | ('POL', 'Sector', 'Recycling') | 1.38202 | | ('PRT', 'Sector', 'Re-export & Re-import') | 0.42461 | | ('QAT', 'Sector', 'Re-export & Re-import') | 1.35223 | | ('MDA', 'Sector', 'Agriculture') | 6.18846 | | ('MDA', 'Sector', 'Fishing') | 9.72973 | | ('MDA', 'Sector', 'Mining and Quarrying') | 11.5293 | | ('MDA', 'Sector', 'Food & Beverages') | 4.9538 | | ('MDA', 'Sector', 'Textiles and Wearing Apparel') | 4.58124 | | ('MDA', 'Sector', 'Wood and Paper') | 7.99061 | | ('MDA', 'Sector', 'Petroleum, Chemical and Non-Metallic Mineral Products') | 8.07634 | | ('MDA', 'Sector', 'Metal Products') | 5.68229 | | ('MDA', 'Sector', 'Electrical and Machinery') | 6.87075 | | ('MDA', 'Sector', 'Transport Equipment') | 6.46095 | | ('MDA', 'Sector', 'Other Manufacturing') | 6.48972 | | ('MDA', 'Sector', 'Recycling') | 5.68197 | | ('MDA', 'Sector', 'Electricity, Gas and Water') | 7.81911 | | ('MDA', 'Sector', 'Construction') | 7.96199 | | ('MDA', 'Sector', 'Maintenance and Repair') | 6.70893 | | ('MDA', 'Sector', 'Wholesale Trade') | 6.16538 | | ('MDA', 'Sector', 'Retail Trade') | 58.91 | | ('MDA', 'Sector', 'Hotels and Restraurants') | 8.14513 | | ('MDA', 'Sector', 'Transport') | 5.60782 | | ('MDA', 'Sector', 'Post and Telecommunications') | 7.52637 | | ('MDA', 'Sector', 'Finacial Intermediation and Business Activities') | 7.00899 | | ('MDA', 'Sector', 'Public Administration') | 11.3311 | | ('MDA', 'Sector', 'Education, Health and Other Services') | 9.54645 | | ('MDA', 'Sector', 'Private Households') | 5.71053 | | ('MDA', 'Sector', 'Others') | 75.168 | | ('MDA', 'Sector', 'Re-export & Re-import') | 43.8839 | | ('ROU', 'Sector', 'Recycling') | 0.388788 | | ('ROU', 'Sector', 'Others') | 1.49361 | | ('RUS', 'Sector', 'Transport Equipment') | 0.204647 | | ('RUS', 'Sector', 'Hotels and Restraurants') | 0.413987 | | ('RUS', 'Sector', 'Post and Telecommunications') | 0.252666 | | ('RUS', 'Sector', 'Private Households') | 0.263346 | | ('RUS', 'Sector', 'Others') | 0.263346 | | ('RWA', 'Sector', 'Fishing') | 1.75733 | | ('RWA', 'Sector', 'Mining and Quarrying') | 0.571349 | | ('RWA', 'Sector', 'Recycling') | 1.4633 | | ('RWA', 'Sector', 'Re-export & Re-import') | 1.72752 | | ('WSM', 'Sector', 'Fishing') | 2.086 | | ('WSM', 'Sector', 'Recycling') | 0.620649 | | ('WSM', 'Sector', 'Private Households') | 0.52558 | | ('WSM', 'Sector', 'Re-export & Re-import') | 0.42665 | | ('SMR', 'Sector', 'Fishing') | 2.33925 | | ('SMR', 'Sector', 'Mining and Quarrying') | 0.680796 | | ('SMR', 'Sector', 'Recycling') | 1.34075 | | ('SMR', 'Sector', 'Others') | 1.56046 | | ('STP', 'Sector', 'Agriculture') | 1.43414 | | ('STP', 'Sector', 'Fishing') | 4.18707 | | ('STP', 'Sector', 'Private Households') | 0.543546 | | ('STP', 'Sector', 'Re-export & Re-import') | 0.506051 | | ('SAU', 'Sector', 'Re-export & Re-import') | 9.92775 | | ('SEN', 'Sector', 'Fishing') | 0.586724 | | ('SEN', 'Sector', 'Mining and Quarrying') | 0.682577 | | ('SEN', 'Sector', 'Transport') | 0.543297 | | ('SRB', 'Sector', 'Mining and Quarrying') | 0.605151 | | ('SRB', 'Sector', 'Transport') | 0.665991 | | ('SRB', 'Sector', 'Re-export & Re-import') | 5.75971 | | ('SYC', 'Sector', 'Agriculture') | 0.491853 | | ('SYC', 'Sector', 'Fishing') | 0.552277 | | ('SYC', 'Sector', 'Mining and Quarrying') | 0.176701 | | ('SYC', 'Sector', 'Hotels and Restraurants') | 0.477408 | | ('SYC', 'Sector', 'Transport') | 0.310148 | | ('SYC', 'Sector', 'Finacial Intermediation and Business Activities') | 0.689564 | | ('SYC', 'Sector', 'Private Households') | 0.658554 | | ('SYC', 'Sector', 'Re-export & Re-import') | 0.334876 | | ('SLE', 'Sector', 'Fishing') | 1.57172 | | ('SLE', 'Sector', 'Recycling') | 0.67595 | | ('SLE', 'Sector', 'Transport') | 0.623753 | | ('SGP', 'Sector', 'Mining and Quarrying') | 0.63283 | | ('SGP', 'Sector', 'Re-export & Re-import') | 0.362893 | | ('SVK', 'Sector', 'Wholesale Trade') | 1.39351 | | ('SVK', 'Sector', 'Private Households') | 1.37956 | | ('SVN', 'Sector', 'Retail Trade') | 0.639084 | | ('SVN', 'Sector', 'Private Households') | 1.5169 | | ('SVN', 'Sector', 'Re-export & Re-import') | 1.32029 | | ('SOM', 'Sector', 'Fishing') | 2.36657 | | ('SOM', 'Sector', 'Mining and Quarrying') | 0.210499 | | ('SOM', 'Sector', 'Hotels and Restraurants') | 0.64416 | | ('SOM', 'Sector', 'Transport') | 0.449532 | | ('ZAF', 'Sector', 'Recycling') | 1.36609 | | ('ZAF', 'Sector', 'Private Households') | 0.578792 | | ('ZAF', 'Sector', 'Others') | 0.578793 | | ('ESP', 'Sector', 'Maintenance and Repair') | 0.120444 | | ('ESP', 'Sector', 'Private Households') | 289.483 | | ('ESP', 'Sector', 'Re-export & Re-import') | 8.34156 | | ('SUD', 'Sector', 'Re-export & Re-import') | 40.4157 | | ('SWZ', 'Sector', 'Fishing') | 1.62611 | | ('SWZ', 'Sector', 'Mining and Quarrying') | 0.339474 | | ('SWZ', 'Sector', 'Recycling') | 1.63893 | | ('SWZ', 'Sector', 'Hotels and Restraurants') | 0.696829 | | ('SWZ', 'Sector', 'Transport') | 0.493104 | | ('SWZ', 'Sector', 'Re-export & Re-import') | 0.530081 | | ('SWE', 'Sector', 'Wholesale Trade') | 0.107639 | | ('SWE', 'Sector', 'Retail Trade') | 2.38436 | | ('CHE', 'Sector', 'Recycling') | 1.74758 | | ('CHE', 'Sector', 'Public Administration') | 3.70809 | | ('CHE', 'Sector', 'Re-export & Re-import') | 0.0483251 | | ('SYR', 'Sector', 'Re-export & Re-import') | 1.31428 | | ('THA', 'Sector', 'Re-export & Re-import') | 0.567591 | | ('MKD', 'Sector', 'Fishing') | 1.60939 | | ('MKD', 'Sector', 'Mining and Quarrying') | 0.371314 | | ('MKD', 'Sector', 'Maintenance and Repair') | 0.489782 | | ('MKD', 'Sector', 'Hotels and Restraurants') | 0.645584 | | ('MKD', 'Sector', 'Private Households') | 0.417274 | | ('MKD', 'Sector', 'Re-export & Re-import') | 1.5252 | | ('TGO', 'Sector', 'Mining and Quarrying') | 0.473924 | | ('TGO', 'Sector', 'Transport') | 0.522329 | | ('TGO', 'Sector', 'Re-export & Re-import') | 0.497329 | | ('TTO', 'Sector', 'Re-export & Re-import') | 0.597277 | | ('TUN', 'Sector', 'Fishing') | 0.663696 | | ('TUN', 'Sector', 'Mining and Quarrying') | 0.660655 | | ('TKM', 'Sector', 'Re-export & Re-import') | 0.296736 | | ('USR', 'Sector', 'Agriculture') | 3.84318 | | ('USR', 'Sector', 'Fishing') | 3.84832 | | ('USR', 'Sector', 'Mining and Quarrying') | 3.87224 | | ('USR', 'Sector', 'Food & Beverages') | 3.89629 | | ('USR', 'Sector', 'Textiles and Wearing Apparel') | 3.92064 | | ('USR', 'Sector', 'Wood and Paper') | 3.94522 | | ('USR', 'Sector', 'Petroleum, Chemical and Non-Metallic Mineral Products') | 3.97002 | | ('USR', 'Sector', 'Metal Products') | 3.99505 | | ('USR', 'Sector', 'Electrical and Machinery') | 4.02033 | | ('USR', 'Sector', 'Transport Equipment') | 4.04583 | | ('USR', 'Sector', 'Other Manufacturing') | 4.07158 | | ('USR', 'Sector', 'Recycling') | 4.09757 | | ('USR', 'Sector', 'Electricity, Gas and Water') | 4.12391 | | ('USR', 'Sector', 'Construction') | 4.15223 | | ('USR', 'Sector', 'Maintenance and Repair') | 4.17894 | | ('USR', 'Sector', 'Wholesale Trade') | 4.20597 | | ('USR', 'Sector', 'Retail Trade') | 4.23327 | | ('USR', 'Sector', 'Hotels and Restraurants') | 4.26085 | | ('USR', 'Sector', 'Transport') | 4.28875 | | ('USR', 'Sector', 'Post and Telecommunications') | 4.31689 | | ('USR', 'Sector', 'Finacial Intermediation and Business Activities') | 4.34336 | | ('USR', 'Sector', 'Public Administration') | 4.37397 | | ('USR', 'Sector', 'Education, Health and Other Services') | 4.40298 | | ('USR', 'Sector', 'Private Households') | 4.4323 | | ('USR', 'Sector', 'Others') | 4.45996 | | ('USR', 'Sector', 'Re-export & Re-import') | 4.44419 | | ('UGA', 'Sector', 'Mining and Quarrying') | 0.616635 | | ('ARE', 'Sector', 'Re-export & Re-import') | 5.09356 | | ('GBR', 'Sector', 'Recycling') | 1.67097 | | ('GBR', 'Sector', 'Hotels and Restraurants') | 0.629207 | | ('TZA', 'Sector', 'Fishing') | 0.664603 | | ('TZA', 'Sector', 'Maintenance and Repair') | 0.687347 | | ('USA', 'Sector', 'Recycling') | 0.00357223 | | ('USA', 'Sector', 'Re-export & Re-import') | 111.742 | | ('URY', 'Sector', 'Private Households') | 296.233 | | ('URY', 'Sector', 'Others') | 0.432434 | | ('URY', 'Sector', 'Re-export & Re-import') | 0.352879 | | ('UZB', 'Sector', 'Re-export & Re-import') | 0.619852 | | ('VUT', 'Sector', 'Fishing') | 2.19209 | | ('VUT', 'Sector', 'Mining and Quarrying') | 0.381777 | | ('VUT', 'Sector', 'Transport') | 0.55949 | | ('VUT', 'Sector', 'Private Households') | 0.629678 | | ('VUT', 'Sector', 'Re-export & Re-import') | 0.500515 | | ('ZMB', 'Sector', 'Re-export & Re-import') | 0.626064 | | ('ZWE', 'Sector', 'Agriculture') | 79.1493 | | ('ZWE', 'Sector', 'Fishing') | 61.1683 | | ('ZWE', 'Sector', 'Mining and Quarrying') | 77.9683 | | ('ZWE', 'Sector', 'Food & Beverages') | 85.6493 | | ('ZWE', 'Sector', 'Textiles and Wearing Apparel') | 74.6593 | | ('ZWE', 'Sector', 'Wood and Paper') | 81.9078 | | ('ZWE', 'Sector', 'Petroleum, Chemical and Non-Metallic Mineral Products') | 85.4707 | | ('ZWE', 'Sector', 'Metal Products') | 61.121 | | ('ZWE', 'Sector', 'Electrical and Machinery') | 88.6479 | | ('ZWE', 'Sector', 'Transport Equipment') | 79.528 | | ('ZWE', 'Sector', 'Other Manufacturing') | 73.375 | | ('ZWE', 'Sector', 'Recycling') | 12.5272 | | ('ZWE', 'Sector', 'Electricity, Gas and Water') | 93.151 | | ('ZWE', 'Sector', 'Construction') | 78.228 | | ('ZWE', 'Sector', 'Maintenance and Repair') | 63.6672 | | ('ZWE', 'Sector', 'Wholesale Trade') | 91.0589 | | ('ZWE', 'Sector', 'Retail Trade') | 98.7206 | | ('ZWE', 'Sector', 'Hotels and Restraurants') | 68.2833 | | ('ZWE', 'Sector', 'Transport') | 64.7867 | | ('ZWE', 'Sector', 'Post and Telecommunications') | 88.7394 | | ('ZWE', 'Sector', 'Finacial Intermediation and Business Activities') | 91.4021 | | ('ZWE', 'Sector', 'Public Administration') | 85.5732 | | ('ZWE', 'Sector', 'Education, Health and Other Services') | 80.0968 | | ('ZWE', 'Sector', 'Private Households') | 51.6251 | | ('ZWE', 'Sector', 'Others') | 65.7326 | | ('ZWE', 'Sector', 'Re-export & Re-import') | 4.01465 | +----------------------------------------------------------------------------+---------------+
False
# removing all the satellite account except the Energy usage using aggrgation function
# Finding the Energy Usage accounts using search function
energy_usages = world.search(item='Satellite account',search= 'Energy Usage')
# Creating the aggregation dataframe
aggregator = pd.DataFrame(data = 'unused',
index=world.E.index,# taking the index of E matrix
columns= ['Aggregation']
)
# Filling the energy_usages with their names to dont aggregate/remove then
aggregator.loc[energy_usages,'Aggregation']= energy_usages
# calling the aggregate function
level = 'Satellite account'
world.aggregate(io={level:aggregator}, # defining the io with a dict
levels=level, # defining the level to aggregate
)
# new E matrix
world.E
Region | AFG | ... | ZWE | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Level | Sector | ... | Sector | ||||||||||||||||||
Item | Agriculture | Fishing | Mining and Quarrying | Food & Beverages | Textiles and Wearing Apparel | Wood and Paper | Petroleum, Chemical and Non-Metallic Mineral Products | Metal Products | Electrical and Machinery | Transport Equipment | ... | Retail Trade | Hotels and Restraurants | Transport | Post and Telecommunications | Finacial Intermediation and Business Activities | Public Administration | Education, Health and Other Services | Private Households | Others | Re-export & Re-import |
Energy Usage (TJ) - Natural Gas | 14.5665 | 0.424861 | 6.35112 | 32.6228 | 5.95376 | 15.3731 | 42.8622 | 17.4204 | 44.2079 | 23.9727 | ... | 0.00000 | 0.0000 | 0.0000 | 0.00000 | 0.000 | 0.0000 | 0.0000 | 0.00000 | 0.00000 | 0.0 |
Energy Usage (TJ) - Coal | 11.8107 | 0.344482 | 5.14956 | 26.4509 | 4.82737 | 12.4647 | 34.7532 | 14.1247 | 35.8443 | 19.4373 | ... | 362.14900 | 683.7270 | 1696.1200 | 594.74900 | 1808.420 | 1395.8900 | 1189.2000 | 159.37400 | 0.00000 | 0.0 |
Energy Usage (TJ) - Petroleum | 0.0000 | 0.000000 | 0.00000 | 0.0000 | 0.00000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | ... | 4.11468 | 7.7684 | 17262.7000 | 6.75744 | 20.547 | 15.8599 | 13.5115 | 1.81078 | 2723.33000 | 0.0 |
Energy Usage (TJ) - Nuclear Electricity | 0.0000 | 0.000000 | 0.00000 | 0.0000 | 0.00000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | ... | 0.00000 | 0.0000 | 0.0000 | 0.00000 | 0.000 | 0.0000 | 0.0000 | 0.00000 | 0.00000 | 0.0 |
Energy Usage (TJ) - Hydroelectric Electricity | 0.0000 | 0.000000 | 0.00000 | 0.0000 | 0.00000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | ... | 0.00000 | 0.0000 | 0.0000 | 0.00000 | 0.000 | 0.0000 | 0.0000 | 0.00000 | 0.00000 | 0.0 |
Energy Usage (TJ) - Geothermal Electricity | 0.0000 | 0.000000 | 0.00000 | 0.0000 | 0.00000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | ... | 0.00000 | 0.0000 | 0.0000 | 0.00000 | 0.000 | 0.0000 | 0.0000 | 0.00000 | 0.00000 | 0.0 |
Energy Usage (TJ) - Wind Electricity | 0.0000 | 0.000000 | 0.00000 | 0.0000 | 0.00000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | ... | 0.00000 | 0.0000 | 0.0000 | 0.00000 | 0.000 | 0.0000 | 0.0000 | 0.00000 | 0.00000 | 0.0 |
Energy Usage (TJ) - Solar, Tide and Wave Electricity | 0.0000 | 0.000000 | 0.00000 | 0.0000 | 0.00000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | ... | 0.00000 | 0.0000 | 0.0000 | 0.00000 | 0.000 | 0.0000 | 0.0000 | 0.00000 | 0.00000 | 0.0 |
Energy Usage (TJ) - Biomass and Waste Electricity | 0.0000 | 0.000000 | 0.00000 | 0.0000 | 0.00000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | ... | 4.11627 | 7.7714 | 13.0921 | 6.76005 | 20.555 | 15.8660 | 13.5167 | 1.81148 | 1.91107 | 0.0 |
9 rows × 4914 columns
Eora Single Region¶
path = r'IO_AUS_2015_BasicPrice.txt'
AUS = mario.parse_eora(
path=path,
multi_region=False,
aggregate_trade= False # keeping the trades with any region in the database
)
C:\Users\payam\Documents\GitHub\MARIO\mario\tools\parsersclass.py:346: DtypeWarning: Columns (0) have mixed types.Specify dtype option on import or set low_memory=False. C:\Users\payam\anaconda3\lib\site-packages\pandas\core\generic.py:4150: PerformanceWarning: dropping on a non-lexsorted multi-index without a level parameter may impact performance.
# Value added matrix
AUS.V
Region | Australia | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Level | Sector | ||||||||||||||||||||
Item | Sheep and lambs | Shorn wool | Oats, sorghum and other cereal grains | Wheat | Barley | Rice | Oilseeds | Legumes | Beef cattle | Untreated milk | ... | Sport and recreation services (incl horse and dog racing, sports grounds, services) | Personal services | Photographic film processing | Community services and religious organisations | Interest groups and community organisations | Police | Corrective centres | Fire brigade | Sanitary and garbage disposal | Re-export |
Item | |||||||||||||||||||||
Compensation of employees D.1 | 2.556220e+08 | 2.433937e+08 | 7.336618e+07 | 3.146963e+08 | 1.122533e+08 | 1.532834e+07 | 2.895112e+07 | 3.808025e+07 | 1.326969e+09 | 1.189331e+08 | ... | 3.361140e+09 | 4.401588e+09 | 5.739301e+08 | 3.127360e+09 | 7.186972e+09 | 4.824663e+09 | 1.606611e+09 | 1.298814e+09 | 7.169460e+08 | 3.987337e+02 |
Taxes on production D.29 | 5.924522e+06 | 5.236558e+06 | 1.747110e+06 | 7.466145e+06 | 2.858386e+06 | 3.653033e+05 | 7.074210e+05 | 1.003368e+06 | 1.574106e+07 | 2.584761e+06 | ... | 1.764520e+07 | 1.184938e+07 | 1.499049e+06 | 2.502957e+07 | 1.044704e+07 | 7.161947e+06 | 2.317332e+06 | 1.928980e+06 | 9.854777e+05 | 3.987337e+02 |
Subsidies on production D.39 | -3.982510e+02 | -4.255667e+02 | -5.574359e+02 | -7.299914e+02 | -5.181845e+02 | -6.731255e+02 | -6.697036e+02 | -6.769138e+02 | -4.100346e+02 | -5.599736e+02 | ... | -3.495486e+02 | -3.564911e+02 | -3.388479e+02 | -5.139558e+02 | -3.408873e+02 | -4.818684e+02 | -4.473704e+02 | -4.313031e+02 | -3.759746e+02 | -3.084256e+02 |
Net operating surplus B.2n | 8.653479e+08 | 7.636153e+08 | 3.861760e+08 | 1.568198e+09 | 5.982055e+08 | 7.540848e+07 | 1.486669e+08 | 1.974871e+08 | 3.062457e+09 | 2.532524e+08 | ... | 6.620869e+08 | 8.688302e+08 | 1.038264e+08 | 2.802075e+08 | 3.649793e+08 | 2.702725e+08 | 8.240794e+07 | 6.939703e+07 | 1.692389e+07 | 3.987337e+02 |
Net mixed income B.3n | 8.036153e+07 | 7.063326e+07 | 3.512474e+07 | 1.500548e+08 | 5.493422e+07 | 6.752769e+06 | 1.336661e+07 | 1.779826e+07 | 3.109050e+08 | 2.287670e+07 | ... | 5.917697e+07 | 7.770368e+07 | 9.265546e+06 | 2.501862e+07 | 3.259638e+07 | 2.414360e+07 | 7.353610e+06 | 6.195869e+06 | 1.509936e+06 | 3.987337e+02 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
Import From Viet Nam | 7.379228e+05 | 1.076063e+06 | 8.115792e+05 | 7.208088e+05 | 2.130037e+05 | 7.076472e+04 | 1.459128e+05 | 1.300391e+05 | 1.437444e+06 | 7.993276e+05 | ... | 4.168866e+06 | 3.671290e+06 | 3.828300e+05 | 1.580519e+06 | 2.677914e+06 | 2.252865e+06 | 6.679025e+05 | 7.136330e+05 | 6.717864e+05 | 4.074160e+06 |
Import From Yemen | 1.609756e+04 | 2.102819e+04 | 1.196540e+04 | 2.100690e+04 | 1.365229e+04 | 8.108515e+03 | 1.049776e+04 | 1.052042e+04 | 2.349277e+04 | 2.265923e+04 | ... | 1.823329e+05 | 1.227823e+05 | 1.658229e+04 | 7.964904e+04 | 1.281645e+05 | 1.073916e+05 | 3.615555e+04 | 3.828378e+04 | 3.621322e+04 | 1.004808e+05 |
Import From Zambia | 1.245779e+04 | 1.274972e+04 | 1.340160e+04 | 1.016656e+04 | 1.079732e+04 | 9.122464e+03 | 9.678976e+03 | 9.652559e+03 | 1.492284e+04 | 1.161494e+04 | ... | 2.348715e+04 | 1.842717e+04 | 1.385903e+04 | 1.429528e+04 | 1.883653e+04 | 1.613773e+04 | 1.280334e+04 | 1.328591e+04 | 1.347164e+04 | 1.764952e+04 |
Import From Zimbabwe | 3.951108e+03 | 3.962073e+03 | 3.987687e+03 | 3.668710e+03 | 3.951348e+03 | 3.918034e+03 | 3.944364e+03 | 3.941616e+03 | 3.928798e+03 | 4.004405e+03 | ... | 3.954858e+03 | 3.953485e+03 | 3.982567e+03 | 3.949252e+03 | 3.977558e+03 | 3.915654e+03 | 3.921187e+03 | 3.949097e+03 | 3.936648e+03 | 3.899365e+03 |
Import From Rest of World | 3.229660e+07 | 3.834387e+07 | 1.766877e+07 | 5.624691e+07 | 1.888846e+07 | 4.095423e+06 | 5.558659e+06 | 6.490833e+06 | 1.109013e+08 | 1.827571e+07 | ... | 1.725137e+08 | 1.476738e+08 | 1.934893e+07 | 6.461909e+07 | 1.103917e+08 | 5.792222e+07 | 1.629316e+07 | 1.915407e+07 | 2.460468e+07 | 6.202203e+06 |
196 rows × 345 columns
Multi regional monetary supply and use exiobase
import mario
# database path in local storage
path= r'MRSUT_2021.zip'
world = mario.parse_exiobase_sut(path=path,year=2011,name='mrsut example')
# getting the Activities and Commodities
world.get_index('Activity')
['Cultivation of paddy rice', 'Cultivation of wheat', 'Cultivation of cereal grains nec', 'Cultivation of vegetables, fruit, nuts', 'Cultivation of oil seeds', 'Cultivation of sugar cane, sugar beet', 'Cultivation of plant-based fibers', 'Cultivation of crops nec', 'Cattle farming', 'Pigs farming', 'Poultry farming', 'Meat animals nec', 'Animal products nec', 'Raw milk', 'Wool, silk-worm cocoons', 'Manure treatment (conventional), storage and land application', 'Manure treatment (biogas), storage and land application', 'Forestry, logging and related service activities (02)', 'Fishing, operating of fish hatcheries and fish farms; service activities incidental to fishing (05)', 'Mining of coal and lignite; extraction of peat (10)', 'Extraction of crude petroleum and services related to crude oil extraction, excluding surveying', 'Extraction of natural gas and services related to natural gas extraction, excluding surveying', 'Extraction, liquefaction, and regasification of other petroleum and gaseous materials', 'Mining of uranium and thorium ores (12)', 'Mining of iron ores', 'Mining of copper ores and concentrates', 'Mining of nickel ores and concentrates', 'Mining of aluminium ores and concentrates', 'Mining of precious metal ores and concentrates', 'Mining of lead, zinc and tin ores and concentrates', 'Mining of other non-ferrous metal ores and concentrates', 'Quarrying of stone', 'Quarrying of sand and clay', 'Mining of chemical and fertilizer minerals, production of salt, other mining and quarrying n.e.c.', 'Processing of meat cattle', 'Processing of meat pigs', 'Processing of meat poultry', 'Production of meat products nec', 'Processing vegetable oils and fats', 'Processing of dairy products', 'Processed rice', 'Sugar refining', 'Processing of Food products nec', 'Manufacture of beverages', 'Manufacture of fish products', 'Manufacture of tobacco products (16)', 'Manufacture of textiles (17)', 'Manufacture of wearing apparel; dressing and dyeing of fur (18)', 'Tanning and dressing of leather; manufacture of luggage, handbags, saddlery, harness and footwear (19)', 'Manufacture of wood and of products of wood and cork, except furniture; manufacture of articles of straw and plaiting materials (20)', 'Re-processing of secondary wood material into new wood material', 'Pulp', 'Re-processing of secondary paper into new pulp', 'Paper', 'Publishing, printing and reproduction of recorded media (22)', 'Manufacture of coke oven products', 'Petroleum Refinery', 'Processing of nuclear fuel', 'Plastics, basic', 'Re-processing of secondary plastic into new plastic', 'N-fertiliser', 'P- and other fertiliser', 'Chemicals nec', 'Manufacture of rubber and plastic products (25)', 'Manufacture of glass and glass products', 'Re-processing of secondary glass into new glass', 'Manufacture of ceramic goods', 'Manufacture of bricks, tiles and construction products, in baked clay', 'Manufacture of cement, lime and plaster', 'Re-processing of ash into clinker', 'Manufacture of other non-metallic mineral products n.e.c.', 'Manufacture of basic iron and steel and of ferro-alloys and first products thereof', 'Re-processing of secondary steel into new steel', 'Precious metals production', 'Re-processing of secondary preciuos metals into new preciuos metals', 'Aluminium production', 'Re-processing of secondary aluminium into new aluminium', 'Lead, zinc and tin production', 'Re-processing of secondary lead into new lead, zinc and tin', 'Copper production', 'Re-processing of secondary copper into new copper', 'Other non-ferrous metal production', 'Re-processing of secondary other non-ferrous metals into new other non-ferrous metals', 'Casting of metals', 'Manufacture of fabricated metal products, except machinery and equipment (28)', 'Manufacture of machinery and equipment n.e.c. (29)', 'Manufacture of office machinery and computers (30)', 'Manufacture of electrical machinery and apparatus n.e.c. (31)', 'Manufacture of radio, television and communication equipment and apparatus (32)', 'Manufacture of medical, precision and optical instruments, watches and clocks (33)', 'Manufacture of motor vehicles, trailers and semi-trailers (34)', 'Manufacture of other transport equipment (35)', 'Manufacture of furniture; manufacturing n.e.c. (36)', 'Recycling of waste and scrap', 'Recycling of bottles by direct reuse', 'Production of electricity by coal', 'Production of electricity by gas', 'Production of electricity by nuclear', 'Production of electricity by hydro', 'Production of electricity by wind', 'Production of electricity by petroleum and other oil derivatives', 'Production of electricity by biomass and waste', 'Production of electricity by solar photovoltaic', 'Production of electricity by solar thermal', 'Production of electricity by tide, wave, ocean', 'Production of electricity by Geothermal', 'Production of electricity nec', 'Transmission of electricity', 'Distribution and trade of electricity', 'Manufacture of gas; distribution of gaseous fuels through mains', 'Steam and hot water supply', 'Collection, purification and distribution of water (41)', 'Construction (45)', 'Re-processing of secondary construction material into aggregates', 'Sale, maintenance, repair of motor vehicles, motor vehicles parts, motorcycles, motor cycles parts and accessoiries', 'Retail sale of automotive fuel', 'Wholesale trade and commission trade, except of motor vehicles and motorcycles (51)', 'Retail trade, except of motor vehicles and motorcycles; repair of personal and household goods (52)', 'Hotels and restaurants (55)', 'Transport via railways', 'Other land transport', 'Transport via pipelines', 'Sea and coastal water transport', 'Inland water transport', 'Air transport (62)', 'Supporting and auxiliary transport activities; activities of travel agencies (63)', 'Post and telecommunications (64)', 'Financial intermediation, except insurance and pension funding (65)', 'Insurance and pension funding, except compulsory social security (66)', 'Activities auxiliary to financial intermediation (67)', 'Real estate activities (70)', 'Renting of machinery and equipment without operator and of personal and household goods (71)', 'Computer and related activities (72)', 'Research and development (73)', 'Other business activities (74)', 'Public administration and defence; compulsory social security (75)', 'Education (80)', 'Health and social work (85)', 'Incineration of waste: Food', 'Incineration of waste: Paper', 'Incineration of waste: Plastic', 'Incineration of waste: Metals and Inert materials', 'Incineration of waste: Textiles', 'Incineration of waste: Wood', 'Incineration of waste: Oil/Hazardous waste', 'Biogasification of food waste, incl. land application', 'Biogasification of paper, incl. land application', 'Biogasification of sewage slugde, incl. land application', 'Composting of food waste, incl. land application', 'Composting of paper and wood, incl. land application', 'Waste water treatment, food', 'Waste water treatment, other', 'Landfill of waste: Food', 'Landfill of waste: Paper', 'Landfill of waste: Plastic', 'Landfill of waste: Inert/metal/hazardous', 'Landfill of waste: Textiles', 'Landfill of waste: Wood', 'Activities of membership organisation n.e.c. (91)', 'Recreational, cultural and sporting activities (92)', 'Other service activities (93)', 'Private households with employed persons (95)', 'Extra-territorial organizations and bodies']
world.get_index('Commodity')
['Paddy rice', 'Wheat', 'Cereal grains nec', 'Vegetables, fruit, nuts', 'Oil seeds', 'Sugar cane, sugar beet', 'Plant-based fibers', 'Crops nec', 'Cattle', 'Pigs', 'Poultry', 'Meat animals nec', 'Animal products nec', 'Raw milk', 'Wool, silk-worm cocoons', 'Manure (conventional treatment)', 'Manure (biogas treatment)', 'Products of forestry, logging and related services (02)', 'Fish and other fishing products; services incidental of fishing (05)', 'Anthracite', 'Coking Coal', 'Other Bituminous Coal', 'Sub-Bituminous Coal', 'Patent Fuel', 'Lignite/Brown Coal', 'BKB/Peat Briquettes', 'Peat', 'Crude petroleum and services related to crude oil extraction, excluding surveying', 'Natural gas and services related to natural gas extraction, excluding surveying', 'Natural Gas Liquids', 'Other Hydrocarbons', 'Uranium and thorium ores (12)', 'Iron ores', 'Copper ores and concentrates', 'Nickel ores and concentrates', 'Aluminium ores and concentrates', 'Precious metal ores and concentrates', 'Lead, zinc and tin ores and concentrates', 'Other non-ferrous metal ores and concentrates', 'Stone', 'Sand and clay', 'Chemical and fertilizer minerals, salt and other mining and quarrying products n.e.c.', 'Products of meat cattle', 'Products of meat pigs', 'Products of meat poultry', 'Meat products nec', 'products of Vegetable oils and fats', 'Dairy products', 'Processed rice', 'Sugar', 'Food products nec', 'Beverages', 'Fish products', 'Tobacco products (16)', 'Textiles (17)', 'Wearing apparel; furs (18)', 'Leather and leather products (19)', 'Wood and products of wood and cork (except furniture); articles of straw and plaiting materials (20)', 'Wood material for treatment, Re-processing of secondary wood material into new wood material', 'Pulp', 'Secondary paper for treatment, Re-processing of secondary paper into new pulp', 'Paper and paper products', 'Printed matter and recorded media (22)', 'Coke Oven Coke', 'Gas Coke', 'Coal Tar', 'Motor Gasoline', 'Aviation Gasoline', 'Gasoline Type Jet Fuel', 'Kerosene Type Jet Fuel', 'Kerosene', 'Gas/Diesel Oil', 'Heavy Fuel Oil', 'Refinery Gas', 'Liquefied Petroleum Gases (LPG)', 'Refinery Feedstocks', 'Ethane', 'Naphtha', 'White Spirit & SBP', 'Lubricants', 'Bitumen', 'Paraffin Waxes', 'Petroleum Coke', 'Non-specified Petroleum Products', 'Nuclear fuel', 'Plastics, basic', 'Secondary plastic for treatment, Re-processing of secondary plastic into new plastic', 'N-fertiliser', 'P- and other fertiliser', 'Chemicals nec', 'Charcoal', 'Additives/Blending Components', 'Biogasoline', 'Biodiesels', 'Other Liquid Biofuels', 'Rubber and plastic products (25)', 'Glass and glass products', 'Secondary glass for treatment, Re-processing of secondary glass into new glass', 'Ceramic goods', 'Bricks, tiles and construction products, in baked clay', 'Cement, lime and plaster', 'Ash for treatment, Re-processing of ash into clinker', 'Other non-metallic mineral products', 'Basic iron and steel and of ferro-alloys and first products thereof', 'Secondary steel for treatment, Re-processing of secondary steel into new steel', 'Precious metals', 'Secondary preciuos metals for treatment, Re-processing of secondary preciuos metals into new preciuos metals', 'Aluminium and aluminium products', 'Secondary aluminium for treatment, Re-processing of secondary aluminium into new aluminium', 'Lead, zinc and tin and products thereof', 'Secondary lead for treatment, Re-processing of secondary lead into new lead', 'Copper products', 'Secondary copper for treatment, Re-processing of secondary copper into new copper', 'Other non-ferrous metal products', 'Secondary other non-ferrous metals for treatment, Re-processing of secondary other non-ferrous metals into new other non-ferrous metals', 'Foundry work services', 'Fabricated metal products, except machinery and equipment (28)', 'Machinery and equipment n.e.c. (29)', 'Office machinery and computers (30)', 'Electrical machinery and apparatus n.e.c. (31)', 'Radio, television and communication equipment and apparatus (32)', 'Medical, precision and optical instruments, watches and clocks (33)', 'Motor vehicles, trailers and semi-trailers (34)', 'Other transport equipment (35)', 'Furniture; other manufactured goods n.e.c. (36)', 'Secondary raw materials', 'Bottles for treatment, Recycling of bottles by direct reuse', 'Electricity by coal', 'Electricity by gas', 'Electricity by nuclear', 'Electricity by hydro', 'Electricity by wind', 'Electricity by petroleum and other oil derivatives', 'Electricity by biomass and waste', 'Electricity by solar photovoltaic', 'Electricity by solar thermal', 'Electricity by tide, wave, ocean', 'Electricity by Geothermal', 'Electricity nec', 'Transmission services of electricity', 'Distribution and trade services of electricity', 'Coke oven gas', 'Blast Furnace Gas', 'Oxygen Steel Furnace Gas', 'Gas Works Gas', 'Biogas', 'Distribution services of gaseous fuels through mains', 'Steam and hot water supply services', 'Collected and purified water, distribution services of water (41)', 'Construction work (45)', 'Secondary construction material for treatment, Re-processing of secondary construction material into aggregates', 'Sale, maintenance, repair of motor vehicles, motor vehicles parts, motorcycles, motor cycles parts and accessoiries', 'Retail trade services of motor fuel', 'Wholesale trade and commission trade services, except of motor vehicles and motorcycles (51)', 'Retail trade services, except of motor vehicles and motorcycles; repair services of personal and household goods (52)', 'Hotel and restaurant services (55)', 'Railway transportation services', 'Other land transportation services', 'Transportation services via pipelines', 'Sea and coastal water transportation services', 'Inland water transportation services', 'Air transport services (62)', 'Supporting and auxiliary transport services; travel agency services (63)', 'Post and telecommunication services (64)', 'Financial intermediation services, except insurance and pension funding services (65)', 'Insurance and pension funding services, except compulsory social security services (66)', 'Services auxiliary to financial intermediation (67)', 'Real estate services (70)', 'Renting services of machinery and equipment without operator and of personal and household goods (71)', 'Computer and related services (72)', 'Research and development services (73)', 'Other business services (74)', 'Public administration and defence services; compulsory social security services (75)', 'Education services (80)', 'Health and social work services (85)', 'Food waste for treatment: incineration', 'Paper waste for treatment: incineration', 'Plastic waste for treatment: incineration', 'Intert/metal waste for treatment: incineration', 'Textiles waste for treatment: incineration', 'Wood waste for treatment: incineration', 'Oil/hazardous waste for treatment: incineration', 'Food waste for treatment: biogasification and land application', 'Paper waste for treatment: biogasification and land application', 'Sewage sludge for treatment: biogasification and land application', 'Food waste for treatment: composting and land application', 'Paper and wood waste for treatment: composting and land application', 'Food waste for treatment: waste water treatment', 'Other waste for treatment: waste water treatment', 'Food waste for treatment: landfill', 'Paper for treatment: landfill', 'Plastic waste for treatment: landfill', 'Inert/metal/hazardous waste for treatment: landfill', 'Textiles waste for treatment: landfill', 'Wood waste for treatment: landfill', 'Membership organisation services n.e.c. (91)', 'Recreational, cultural and sporting services (92)', 'Other services (93)', 'Private households with employed persons (95)', 'Extra-territorial organizations and bodies']
# Aggregating the database
aggregation_path= r'C:\Users\payam\Desktop\MRSUT Test\Excels\aggregation_test.xlsx'
world.aggregate(
io= aggregation_path,
ignore_nan= True, # will ignore nans in the excel file and does not aggregate them
)
nan values for the aggregation of Activity for following items ignored ['Manufacture of furniture; manufacturing n.e.c. (36)', 'Recycling of waste and scrap', 'Recycling of bottles by direct reuse', 'Production of electricity by coal', 'Production of electricity by gas', 'Production of electricity by nuclear', 'Production of electricity by hydro', 'Production of electricity by wind', 'Production of electricity by petroleum and other oil derivatives', 'Production of electricity by biomass and waste', 'Production of electricity by solar photovoltaic', 'Production of electricity by solar thermal', 'Production of electricity by tide, wave, ocean', 'Production of electricity by Geothermal', 'Production of electricity nec', 'Transmission of electricity', 'Distribution and trade of electricity', 'Extra-territorial organizations and bodies'] ['unused'] does not found in Satellite account and can not be removed. ['unused'] does not found in Satellite account and can not be removed.
# new configuartion of database
print(world)
name = mrsut example table = SUT scenarios = ['baseline'] Activity = 22 Commodity = 4 Factor of production = 2 Satellite account = 1 Consumption category = 1 Region = 3
# calculating the multpliers
world.M
Database: to calculate M following matrices are need. ['m'].Trying to calculate dependencies. Database: to calculate m following matrices are need. ['w'].Trying to calculate dependencies.
Europe | Asia | RoW | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Level | Commodity | Commodity | Commodity | ... | Activity | ||||||||||||||||
Agriculture | Mining | Manufacturing | Services | Agriculture | Mining | Manufacturing | Services | Agriculture | Mining | ... | Production of electricity by biomass and waste | Production of electricity by solar photovoltaic | Production of electricity by solar thermal | Production of electricity by tide, wave, ocean | Production of electricity by Geothermal | Production of electricity nec | Transmission of electricity | Distribution and trade of electricity | Services | Extra-territorial organizations and bodies | |
Value Added1 | 3.296589e+10 | 9.297474e+11 | 1.244670e+12 | 9.784042e+11 | 3.263168e+11 | 3.455338e+12 | 4.710777e+12 | 4.287542e+12 | 2.357422e+11 | 1.276377e+12 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
Value Added2 | 9.444731e+10 | 1.499971e+12 | 2.695647e+12 | 2.102571e+12 | 3.521533e+11 | 4.816340e+12 | 7.935938e+12 | 7.233903e+12 | 1.893915e+11 | 1.300781e+12 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
2 rows × 78 columns
# checking if the database is balanced
world.is_balanced('coefficients')
True
Parsing using pd.DataFrame
from mario import Database
import pandas as pd
import numpy as np
IOT Database¶
# Creating indeces according to mario format
regions = ['reg.1']
Z_levels = ['Sector']
sectors = ['sec.1','sec.2']
factors = ['Labor']
satellite = ['CO2']
Y_level = ['Consumption category']
demands = ['Households']
Z_index = pd.MultiIndex.from_product([regions,Z_levels,sectors])
Y_columns = pd.MultiIndex.from_product([regions,Y_level,demands])
# creating matrices
Z = pd.DataFrame(
data = np.array([
[10,70],
[50,10]]),
index = Z_index,
columns= Z_index
)
Y = pd.DataFrame(
data = np.array([
[200],
[80]]),
index = Z_index,
columns= Y_columns,
)
E = pd.DataFrame(
data = np.array([
[30,20]]),
index = satellite,
columns= Z_index,
)
V = pd.DataFrame(
data = np.array([
[220,60]]),
index = factors,
columns= Z_index,
)
EY = pd.DataFrame(
data = np.array([8]),
index = satellite,
columns= Y_columns,
)
Z
reg.1 | ||||
---|---|---|---|---|
Sector | ||||
sec.1 | sec.2 | |||
reg.1 | Sector | sec.1 | 10 | 70 |
sec.2 | 50 | 10 |
Y
reg.1 | |||
---|---|---|---|
Consumption category | |||
Households | |||
reg.1 | Sector | sec.1 | 200 |
sec.2 | 80 |
V
reg.1 | ||
---|---|---|
Sector | ||
sec.1 | sec.2 | |
Labor | 220 | 60 |
E
reg.1 | ||
---|---|---|
Sector | ||
sec.1 | sec.2 | |
CO2 | 30 | 20 |
EY
reg.1 | |
---|---|
Consumption category | |
Households | |
CO2 | 8 |
# units as a dict of pd.DataFrames
units= {'Sector':pd.DataFrame('EUR',index=sectors,columns=['unit']),
'Satellite account':pd.DataFrame('Ton',index=satellite,columns=['unit']),
'Factor of production': pd.DataFrame('EUR',index=factors,columns=['unit'])}
# Creating a mario database
data = Database(Z=Z,
Y=Y,
E=E,
V=V,
EY=EY,
table='IOT',
units=units,
name='iot test'
)
print(data)
name = iot test table = IOT scenarios = ['baseline'] Factor of production = 1 Satellite account = 1 Consumption category = 1 Region = 1 Sector = 2
# Calculating matrices needed
data.calc_all(['p'])
Database: to calculate p following matrices are need. ['w'].Trying to calculate dependencies.
# Accessing to matrices
data.p
# or when a specific scenario is needed
data['baseline']['p']
price index | |||
---|---|---|---|
Region | Level | Item | |
reg.1 | Sector | sec.1 | 1.0 |
sec.2 | 1.0 |
SUT Database¶
# Creating indeces according to mario format
regions = ['reg.1']
activity_level = ['Activity']
commodity_level = ['Commodity']
activities = ['act.1']
commodities = ['com.1']
activity_index = pd.MultiIndex.from_product([regions,activity_level,activities])
commodity_index = pd.MultiIndex.from_product([regions,commodity_level,commodities])
Z_index = activity_index.append(commodity_index)
factors = ['Labor']
satellite = ['CO2']
Y_level = ['Consumption category']
demands = ['Households']
Y_columns = pd.MultiIndex.from_product([regions,Y_level,demands])
# creating matrices
Z = pd.DataFrame(
data = np.array([
[0,70],
[50,0]]),
index = Z_index,
columns= Z_index
)
Y = pd.DataFrame(
data = np.array([
[0],
[20]]),
index = Z_index,
columns= Y_columns,
)
E = pd.DataFrame(
data = np.array([
[30,0]]),
index = satellite,
columns= Z_index,
)
V = pd.DataFrame(
data = np.array([
[20,0]]),
index = factors,
columns= Z_index,
)
EY = pd.DataFrame(
data = np.array([8]),
index = satellite,
columns= Y_columns,
)
Z
reg.1 | ||||
---|---|---|---|---|
Activity | Commodity | |||
act.1 | com.1 | |||
reg.1 | Activity | act.1 | 0 | 70 |
Commodity | com.1 | 50 | 0 |
Y
reg.1 | |||
---|---|---|---|
Consumption category | |||
Households | |||
reg.1 | Activity | act.1 | 0 |
Commodity | com.1 | 20 |
V
reg.1 | ||
---|---|---|
Activity | Commodity | |
act.1 | com.1 | |
Labor | 20 | 0 |
E
reg.1 | ||
---|---|---|
Activity | Commodity | |
act.1 | com.1 | |
CO2 | 30 | 0 |
EY
reg.1 | |
---|---|
Consumption category | |
Households | |
CO2 | 8 |
# units as a dict of pd.DataFrames
units= {'Activity':pd.DataFrame('EUR',index=activities,columns=['unit']),
'Commodity':pd.DataFrame('EUR',index=commodities,columns=['unit']),
'Satellite account':pd.DataFrame('Ton',index=satellite,columns=['unit']),
'Factor of production': pd.DataFrame('EUR',index=factors,columns=['unit'])}
# Creating a mario database
data = Database(Z=Z,
Y=Y,
E=E,
V=V,
EY=EY,
table='SUT',
units=units,
name='sut test'
)
print(data)
name = sut test table = SUT scenarios = ['baseline'] Activity = 1 Commodity = 1 Factor of production = 1 Satellite account = 1 Consumption category = 1 Region = 1
#Looking at supply matrix
data.s
Region | reg.1 | ||
---|---|---|---|
Level | Commodity | ||
Item | com.1 | ||
Region | Level | Item | |
reg.1 | Activity | act.1 | 1.0 |
#Looking at supply matrix
data.u
Region | reg.1 | ||
---|---|---|---|
Level | Activity | ||
Item | act.1 | ||
Region | Level | Item | |
reg.1 | Commodity | com.1 | 0.714286 |
Parsing EUROSTAT
To parse a EUROSTAT supply and use table with mario, user needs to download the database in correct and specific format from EUROSTAT website. The supply and use tables should be donwloaded as follow:
Where to go
How to configure the database
In which format download the file
When the use and supply files are downloaded, mario can be used to parse the database
# importing the parser
from mario import parse_eurostat
# Defining the file path
supply_path = r"C:\Users\payam\Politecnico di Milano\DENG-SESAM - MARIO\Examples\parse_eurostat\supply.xls"
use_path = r"C:\Users\payam\Politecnico di Milano\DENG-SESAM - MARIO\Examples\parse_eurostat\use.xls"
italy_sut = parse_eurostat(
supply_path = supply_path,
use_path = use_path,
region = "Italy",
year = 2011
)
# how is the the structure of database
print(italy_sut)
name = None table = SUT scenarios = ['baseline'] Activity = 65 Commodity = 65 Factor of production = 6 Satellite account = 1 Consumption category = 3 Region = 1
# Looking some of the items
print(italy_sut.get_index('Activity'))
['Crop and animal production, hunting and related service activities', 'Forestry and logging', 'Fishing and aquaculture', 'Mining and quarrying', 'Manufacture of food products; beverages and tobacco products', 'Manufacture of textiles, wearing apparel, leather and related products', 'Manufacture of wood and of products of wood and cork, except furniture; manufacture of articles of straw and plaiting materials', 'Manufacture of paper and paper products', 'Printing and reproduction of recorded media', 'Manufacture of coke and refined petroleum products', 'Manufacture of chemicals and chemical products', 'Manufacture of basic pharmaceutical products and pharmaceutical preparations', 'Manufacture of rubber and plastic products', 'Manufacture of other non-metallic mineral products', 'Manufacture of basic metals', 'Manufacture of fabricated metal products, except machinery and equipment', 'Manufacture of computer, electronic and optical products', 'Manufacture of electrical equipment', 'Manufacture of machinery and equipment n.e.c.', 'Manufacture of motor vehicles, trailers and semi-trailers', 'Manufacture of other transport equipment', 'Manufacture of furniture; other manufacturing', 'Repair and installation of machinery and equipment', 'Electricity, gas, steam and air conditioning supply', 'Water collection, treatment and supply', 'Sewerage, waste management, remediation activities', 'Construction', 'Wholesale and retail trade and repair of motor vehicles and motorcycles', 'Wholesale trade, except of motor vehicles and motorcycles', 'Retail trade, except of motor vehicles and motorcycles', 'Land transport and transport via pipelines', 'Water transport', 'Air transport', 'Warehousing and support activities for transportation', 'Postal and courier activities', 'Accommodation and food service activities', 'Publishing activities', 'Motion picture, video, television programme production; programming and broadcasting activities', 'Telecommunications', 'Computer programming, consultancy, and information service activities', 'Financial service activities, except insurance and pension funding', 'Insurance, reinsurance and pension funding, except compulsory social security', 'Activities auxiliary to financial services and insurance activities', 'Imputed rents of owner-occupied dwellings', 'Real estate activities excluding imputed rents', 'Legal and accounting activities; activities of head offices; management consultancy activities', 'Architectural and engineering activities; technical testing and analysis', 'Scientific research and development', 'Advertising and market research', 'Other professional, scientific and technical activities; veterinary activities', 'Rental and leasing activities', 'Employment activities', 'Travel agency, tour operator reservation service and related activities', 'Security and investigation, service and landscape, office administrative and support activities', 'Public administration and defence; compulsory social security', 'Education', 'Human health activities', 'Residential care activities and social work activities without accommodation', 'Creative, arts and entertainment activities; libraries, archives, museums and other cultural activities; gambling and betting activities', 'Sports activities and amusement and recreation activities', 'Activities of membership organisations', 'Repair of computers and personal and household goods', 'Other personal service activities', 'Activities of households as employers; undifferentiated goods- and services-producing activities of households for own use', 'Activities of extraterritorial organisations and bodies']
print(italy_sut.get_index('Consumption category'))
['Final consumption expediture', 'Gross Capital formation', 'Exports of goods and services']
Excel parser
Parsing IOT¶
In order to parse an input-output table thorugh excel file, the database should follows a specific format as shown in the following example
The shape of database¶
The shape of units¶
when the files are prepared, the parse_from_excel function can be used
from mario import parse_from_excel
test = parse_from_excel(
path= r'IOT.xlsx', # the path to the excel file
table= 'IOT', # type of the table
#data_sheet='flows' by default function will take the first sheet as the data, in case needed can be changed,
#unit_sheet='units' by default function will take the sheet named units
#mode= 'flows' by default function will assume flows are given in the excel. if data are coefficints, model should be changed
)
test
name = None table = IOT scenarios = ['baseline'] Factor of production = 3 Satellite account = 4 Consumption category = 1 Region = 2 Sector = 6
Parsing SUT¶
The shape of database¶
The shape of units¶
# database can be parsed exactly the same way just by changing the table
test = parse_from_excel(
path= 'SUT.xlsx', # the path to the excel file
table= 'SUT', # type of the table
#data_sheet='flows' by default function will take the first sheet as the data, in case needed can be changed,
#unit_sheet='units' by default function will take the sheet named units
#mode= 'flows' by default function will assume flows are given in the excel. if data are coefficints, model should be changed
)
Plotting by plot_matrix
mario has a generic plot function for plotting the matrices that follows the main rule of the plotly express functions. This function gives the ability to the user to plot basic functions for differnet matrices and different scnearios with a given degree of freedom. In the following example, a couple of examples are represented on IOT and SUT datbases.
IOT Example¶
import mario
# loading a IOT test
test = mario.load_test('IOT')
# plotting total final demand matrix with plot_matrix without separating the regions
test.plot_matrix(
matrix= 'Y',
x = 'Consumption_category', # putting the consumtion categoreis on x axis
color= 'Sector_from', # the colors will define the sectors that consumption categroies coming from,
path= 'final_deamnd.html'
)
# specifying the origin of the final demands and the destinations by facet_row and facet_col
# the following plot defines the consumption of sector outputs from regions to different regions
test.plot_matrix(
matrix = 'Y',
x = 'Consumption_category',
color = 'Sector_from',
facet_row = 'Region_from',
facet_col = 'Region_to',
path= 'final_comnsumtpiton_by_region.html'
)
# User also have the degree of freedom to change the color palettes to another mario default palette or a costumized palette
mario.set_palette('McKinsey')
# User may also filter different sets of the database such as specifying specific sectors or consumption categories by using filters
# In this example, sectors_from (reprsenting the origin/producing sector) is filtered and the origin and destination region also limited
# to Italy
test.plot_matrix(
matrix = 'Y',
x = 'Consumption_category',
color = 'Sector_from',
facet_row = 'Region_from',
facet_col = 'Region_to',
filter_Sector_from = ['Agriculture',
'Mining',
'Services'],
filter_Region_from= ['Italy'],
filter_Region_to = ['Italy'],
path='Italy_final_demand.html'
)
SUT Example¶
test = mario.load_test('SUT')
the sut load_test is a two regions database (Italy, RoW). In order to pot the total use of commodities originated from Italy, the plot_matrix function can be used as follow
test.plot_matrix(
matrix = 'U', # plotting the use flow,
x = 'Item_to', # What to represent on the main items to be plotted on the x axis (in this case, items to the consumption origins)
color = 'Sector_from', # the production sectors define the colors
facet_row = 'Region_from', # specifying the facet rows by region originated
facet_col = 'Region_to', # specifying the facet cols by region consumed,
path='Use flows.html'
)
# plotting the value added
test.plot_matrix(
matrix = 'V', # plotting the value added,
x = 'Factor of production', # What to represent on the main items to be plotted on the x axis (in this case, items to the consumption origins)
color='Activity_to',
path='value added.html',
)
MARIO example gallery
Add Extensions
Add Extension¶
Reading Satellite account from Exiobase3 and adding extensions to Exiobase MRSUT
# importing parser functions
from mario import parse_exiobase_3,parse_exiobase_sut
import pandas as pd
# defining the path of files in the your local storage
sut_path = r'MRSUT_2021.zip'
iot_path = r'IOT_2021_ixi.zip'
# parse database
world_IOT = parse_exiobase_3(path= iot_path,version='3.8.1')
world_SUT = parse_exiobase_sut(path= sut_path)
# Checking the configuration of the IOT database
print(world_IOT)
name = None table = IOT scenarios = ['baseline'] Factor of production = 9 Satellite account = 1104 Consumption category = 7 Region = 49 Sector = 163
# Checking the configuration of the SUT database
print(world_SUT)
name = None table = SUT scenarios = ['baseline'] Activity = 163 Commodity = 200 Factor of production = 12 Satellite account = 1 Consumption category = 7 Region = 49
# creating the excel for the aggregation
world_IOT.get_aggregation_excel(path=r'iot_agg.xlsx')
world_SUT.get_aggregation_excel(path=r'sut_agg.xlsx')
aggregate databases to the same level using excel files to (The structure of excel aggregation generated by mario)¶
# reading aggregation file after filling
world_IOT.aggregate(r'iot_agg.xlsx')
world_SUT.aggregate(r'sut_agg.xlsx')
['unused'] does not found in Satellite account and can not be removed. ['unused'] does not found in Satellite account and can not be removed.
# new configuration of database
print(world_IOT)
name = None table = IOT scenarios = ['baseline'] Factor of production = 3 Satellite account = 4 Consumption category = 1 Region = 2 Sector = 3
# new configuration of database
print(world_SUT)
name = None table = SUT scenarios = ['baseline'] Activity = 3 Commodity = 3 Factor of production = 3 Satellite account = 1 Consumption category = 1 Region = 2
# Taking Satellite account from world_IOT
sat_IOT = world_IOT.E
# Taking Satellite account from world_SUT (is empty)
sat_SUT = world_SUT.E
print(sat_IOT)
OECD RoW \ Level Sector Sector Primary Secondary Services Primary Employment 3.247781e+04 1.267968e+05 4.772136e+05 1.519881e+06 CO2 9.345101e+11 6.590698e+12 1.993111e+12 2.101140e+12 CH4 1.254902e+08 6.015730e+08 3.410832e+08 4.609233e+08 N2O 2.589037e+07 1.873298e+08 6.841114e+07 4.911396e+07 Level Secondary Services Employment 7.571914e+05 1.152171e+06 CO2 1.493025e+13 2.048917e+12 CH4 2.841726e+09 8.739974e+08 N2O 4.310659e+08 5.742075e+07
# Creating a dataframe of extensions
new_sat_SUT = pd.DataFrame(0, index=sat_IOT.index, columns=sat_SUT.columns)
# assigning the values to the dataframe
new_sat_SUT.loc[:,(slice(None),'Activity')] = sat_IOT.values
# taking the units from world_IOT satellite
new_units= world_IOT.units['Satellite account']
print(new_units)
unit Employment 1000 p CO2 kg CH4 kg N2O kg
# add extension using the add_extensions function
world_SUT.add_extensions(io= new_sat_SUT,
matrix= 'E',
units= new_units,
inplace=True, # implementing the changes on the database
)
Using add extensions will rewrite the new results on the baseline and delete other scenarios baseline deleted from the database
# plotting the Footprints (F) for extension CP2
world_SUT.plot_matrix(matrix= 'F',
x= 'Activity_to',
color= 'Region_to',
facet_col = 'Satellite account',
filter_Satellite_account = ['CO2'],
path = 'CO2.html',
)
Database: to calculate F following matrices are need. ['f'].Trying to calculate dependencies. Database: to calculate f following matrices are need. ['w'].Trying to calculate dependencies.
# plot gdp: plotting GDP and haveing the abosulte CO2 sectoral production as the color scale
world_SUT.plot_gdp(extension='CO2',extension_value='absolute',path='gdp.html')
# looking at metadata history
world_SUT.meta_history
[11:53:37] Table added into metadata with value equal to SUT. [11:53:37] Price added into metadata with value equal to None. [11:53:37] Source added into metadata with value equal to Exiobase Monetary Multi Regional Supply and Use Table (https://www.exiobase.eu/). [11:53:37] Year added into metadata with value equal to None. [11:53:37] Database successfully imported. [11:53:37] Number of Region = 49 [11:53:37] Number of Consumption category = 7 [11:53:37] Number of Satellite account = 1 [11:53:37] Number of Factor of production = 12 [11:53:37] Number of Sector = 363 [11:53:37] Number of Activity = 163 [11:53:37] Number of Commodity = 200 [11:54:09] original matrices changed to the aggregated level based on the inputs from sut_agg.xlsx [11:54:09] Region aggregated from 49 levels to 2 levels [11:54:09] Consumption category aggregated from 7 levels to 1 levels [11:54:09] Satellite account aggregated from 1 levels to 1 levels [11:54:09] Factor of production aggregated from 12 levels to 3 levels [11:54:09] Sector aggregated from 363 levels to 363 levels [11:54:09] Activity aggregated from 163 levels to 3 levels [11:54:09] Commodity aggregated from 200 levels to 3 levels [11:54:09] baseline deleted from the database [11:54:09] Modification: new 'Satellite account' added to the database as follow: ['CH4', 'CO2', 'Employment', 'N2O']
Shock and scenario analysis
Scenario Analysis and Shock Implementation in MARIO¶
Implementing a shock without using mario excel platform¶
A scenario can be implemented in multiple ways within mario. Simple shocks may be implemented with mario as follow:
from mario import load_test, slicer
# loading the baseline scenario (using the load_test)
test = load_test('IOT')
# In order to implement a scenario with respect to the baseline, we can clone the baseline database using the clone function
# and creating a new scenario
test.clone_scenario(
scenario='baseline', # from which scenario clone
name='Final demand increase',# what will be the name of the new scenario
)
#checking the scenarios of the model
print(test.scenarios)
['baseline', 'Final demand increase']
lets increase the local final demand of Italy by 10%
# using the loc function of pd.DataFrames, we can implement a change in the final demand of the new scenario
# we may use the slicer function to do it easily
Y_rows = slicer(matrix='Y',axis= 0,Region=['Italy'],Item=['Agriculture'])
Y_cols = slicer(matrix='Y',axis= 1,Region=['Italy'],Item=['Final Demand'])
Y_new = test.matrices['Final demand increase']['Y']
Y_new.loc[Y_rows,Y_cols]*=1.1
# updating the matrix using the update function to track in the metadata
test.update_scenarios(scenario='Final demand increase',Y=Y_new)
# as the new scenario is cloning all the data from baseline, we need to reset the new scenario to coefficients and re calculte
# all the flows
test.reset_to_coefficients(scenario='Final demand increase')
# now using the get_data function, we can see the change in the different matrices. For example:
delta_X = test.get_data(
matrices=['X'],
scenarios= ['Final demand increase'],
base_scenario = 'baseline', # requsting the differential results for matrix X between two scenarios,
format= 'dict',# asking the results in form of a dictionary,
indeces=False,# not intrested at looking at the units information
units=False, # not intrested at lookning database information
)
# looking at the changes
print(delta_X)
{'Final demand increase': {'X': production Region Level Item Italy Sector Agriculture 2961.338965 Construction 57.329630 Manufacturing 597.267115 Mining 6.332699 Services 745.379267 Transport 185.686254 RoW Sector Agriculture 121.156060 Construction 5.421589 Manufacturing 302.857308 Mining 45.949173 Services 193.241123 Transport 36.432992}}
# the output of the get_data function is a comprehensive data on the all the scenarios and matrices asked
print(delta_X['Final demand increase']['X'])
production Region Level Item Italy Sector Agriculture 2961.338965 Construction 57.329630 Manufacturing 597.267115 Mining 6.332699 Services 745.379267 Transport 185.686254 RoW Sector Agriculture 121.156060 Construction 5.421589 Manufacturing 302.857308 Mining 45.949173 Services 193.241123 Transport 36.432992
# The plot_matrix function can be used to plot the changes of the X
test.plot_matrix(
matrix='X', # plotting the X matrix
x='Region_from', # putting the origin regions on the X axis
color='Sector_from', # colors are defined tby the origin sectors
base_scenario='baseline', # printing the delta_x with respect to baseline scenario,
path = 'delta_X.html'
)
Implementing a shock using mario excel platform¶
mario also supports introduction of very complex shocks through an excel platform, which can be generated with mario automatically based on the shape of the database. Then scenarios can be translated with the options of the excel files.
The excel platform alos gives the opprotunity to define cluseters of sets like Region, Secotr,.... to implement more complex shocks
# Simple shock implementation without clusters
test= load_test('IOT')
# request mario to create the excel file for implementing the shocks
save_path = r'shock_iot.xlsx'
test.get_shock_excel(path=save_path)
An excel file will be created in the given path. The excel file has 6 different pages as follow:
- indeces: this page contains all the valid data that can be used for the definition of the shocks. These values are used to validate the data on other sheets
- main: This sheet is an optional sheet that user may use for the intermediate calculations and defining the assumptions of the problem
- Y: This sheet is specified for implementing a shock on the Final demand
- v: This sheet is specified for implementing a shock on tha value added
- e: This sheet is specified for implementing a shock on the satellite account
- z: This sheet is specified for implementing a shock on the intersectoral transaction matrix
In this version of mario, there are different ways to implement a shock (more options will be added to the next versions):
- update: this method updates a value on the coefficient matrix
- Absolute: this method implements the change in terms of absolute values (flows) and implement the change on coefficient matrix
- Percentage: this method implements a percentage change directly on coefficient matrix (the values should be between 0 to 1 meaning that 10% increase is 0.1 and 10% decrease is -0.1)
For example, a scenario with 10% increase in the self consumption of services sector in Italy can be modeled in the excel file as follow:
Finally, the excel file can be passed to shock function to implement the shock
test.shock_calc(io=r'shock_iot.xlsx', # Path to the excel file
z= True, # the shock will be implemented on z
notes=['you may add some notes for metadata']
)
C:\Users\payam\anaconda3\lib\site-packages\openpyxl\worksheet\_reader.py:308: UserWarning: Data Validation extension is not supported and will be removed
# new scenario is added to the list of scenarios
print(test.scenarios)
['baseline', 'shock 1']
# the shock is recorded on metadata
test.meta_history
[14:28:52] Table added into metadata with value equal to IOT. [14:28:52] Price added into metadata with value equal to None. [14:28:52] Source added into metadata with value equal to None. [14:28:52] Year added into metadata with value equal to None. [14:28:52] Database successfully imported. [14:28:52] Number of Region = 2 [14:28:52] Number of Consumption category = 1 [14:28:52] Number of Satellite account = 4 [14:28:52] Number of Factor of production = 3 [14:28:52] Number of Sector = 6 [14:29:45] Shocks implemented from shock_iot.xlsx as follow: [14:29:45] Shock (Notes): you may add some notes for metadata [14:29:45] Shock on z implemented: row_region_:Italy, row_level_:Sector, row_sector_:Services, column_region_:Italy, column_level_:Sector column_sector_:Services, type: Percentage, value: 0.1.
Defining the Clusters¶
In order to impelemnt shocks on a bunch of items, you can use clusters. Lets implement a change in the local final demand of all sectors in italy for 10%, first without the clusters.
In this way, user needs to replicate the same change for all the sectros in italy as shown in the picture
An easier way to this shock is to use clusters. In this case user needs to define a cluster on the 'Sector'. But clusters can be defined on all the sets of the table (for checking all the sets of table you can use test.sets)
A cluster on sectors can be defined as follow:
clusters = {'Sector': # Cluster on which set
{'All': test.get_index('Sector') # what is the name of the cluster and what it contains
}
}
So in this case, we are making a cluster on Sector. The cluster will be called All and it contains all the Sectors in the database. Now if we request mario to generate the shock excel, 'All' is added as a valid option for the Sector.
save_path = r'shock_iot_cluster.xlsx'
test.get_shock_excel(path=save_path,**clusters)
The same shock now can be implemented as the shown in the pic:
In order to implement a shock, we need to use the excel files and the definition of clusters as follow:
test.shock_calc(io=r'shock_iot_cluster.xlsx', # Path to the excel file
Y= True, # the shock will be implemented on Y
**clusters
)
# lets look at the meta history
test.meta_history
[14:28:52] Table added into metadata with value equal to IOT. [14:28:52] Price added into metadata with value equal to None. [14:28:52] Source added into metadata with value equal to None. [14:28:52] Year added into metadata with value equal to None. [14:28:52] Database successfully imported. [14:28:52] Number of Region = 2 [14:28:52] Number of Consumption category = 1 [14:28:52] Number of Satellite account = 4 [14:28:52] Number of Factor of production = 3 [14:28:52] Number of Sector = 6 [14:29:45] Shocks implemented from shock_iot.xlsx as follow: [14:29:45] Shock (Notes): you may add some notes for metadata [14:29:45] Shock on z implemented: row_region_:Italy, row_level_:Sector, row_sector_:Services, column_region_:Italy, column_level_:Sector column_sector_:Services, type: Percentage, value: 0.1. [14:30:53] Shocks implemented from shock_iot_cluster.xlsx as follow: [14:30:53] Shock on Y implemented: row_region:Italy, row_level:Sector, row_sector:['Agriculture', 'Mining', 'Manufacturing', 'Services', 'Construction', 'Transport'], column_region:Italy, demand_category: Final Demand, type: Percentage, value: 0.1.
# lets have a look on the changes
test['shock 2']['Y']-test['baseline']['Y']
Region | Italy | RoW | ||
---|---|---|---|---|
Level | Consumption category | Consumption category | ||
Item | Final Demand | Final Demand | ||
Region | Level | Item | ||
Italy | Sector | Agriculture | 2843.470784 | 0.0 |
Construction | 14477.315982 | 0.0 | ||
Manufacturing | 29989.891113 | 0.0 | ||
Mining | 92.199216 | 0.0 | ||
Services | 105284.650130 | 0.0 | ||
Transport | 5738.524814 | 0.0 | ||
RoW | Sector | Agriculture | 0.000000 | 0.0 |
Construction | 0.000000 | 0.0 | ||
Manufacturing | 0.000000 | 0.0 | ||
Mining | 0.000000 | 0.0 | ||
Services | 0.000000 | 0.0 | ||
Transport | 0.000000 | 0.0 |
API Reference
Analyzing database
|
Checks if a specific data_set in the database is balance or not |
|
Checks the productivity of the system |
Defines if a database is single region or multi-region |
|
checks if the database is hybrid or monetary |
|
Returns a list of levels of info in the model |
|
Returns all the scenarios existed in the model |
|
Returns the type of the database |
|
|
Returns a list or a DataFrame of different levels of indeces in the database. |
Database modification
|
This function is in charge of reading data regarding the aggregation |
|
Adds a Sector/Activity/Commodity to the database |
|
Extracts a single region from multi-region databases |
|
The function will transform a SUT table to a IOT table |
|
Adding a new extension [Factor of production or Satellite account] to the database passing the coefficients or the absolute values. |
|
Updates the matrices for a specific scenario. |
|
Deletes the coefficients of a scenario and keeps only flows |
|
Deletes the flows of a scenario and keeps only coefficients |
|
Creates a new scenario by cloning an existing scenario |
Returns a deepcopy of the instance |
|
The function creates a backup of the last configuration of database to be returned in case needed. |
|
This function is in charge of reseting back the database to the last back-up. |
Shock analysis
|
Implements shocks on different matrices with the possibility of defining clusters on every level of information. |
Data visualization
|
Sets the default palette of plots |
|
Plots sectoral GDP with additional info |
|
Creates bubble plots |
|
Plots linkages in different modes |
|
Generates a general html barplot giving the user certain degrees of freedom such as: |
Get excels
mario has some functions providing automatic excel file generations for easing some of the functionalities such as aggrgeaton and adding sectors.
|
Generates the Excel file for aggregation of the database |
|
Generates an Excel file for easing the add extension functionality |
|
Generates an Excel file to add a sector/activity/commodity to the database |
|
Creates an Excel file based on the shape and the format |
Save data
|
Saves the database into an Excel file |
|
Saves the database multiple text file based on given inputs |
|
Returns a pymrio.IOSystem from a mario.Database |
Database parsers
Structured Databases
mario supports automatic parsing of following database:
Exiobase
Eurostat Supply and Use
Eora26
Eora single region
|
Parsing exiobase3 |
|
Parsing exiobase mrsut |
|
Parsing Eurostat databases |
|
Parsing eora databases |
|
Parsing a pymrio database |
|
reads hybrid supply and use exiobase |
|
A unique function for parsing all exiobase databases |
Non-Structured Databases
When databases are not structured (coming from abovementioned sources), excel or text parsers can be used. The databases in this case, should follow specific rules:
|
Parsing database from excel file |
|
Parsing database from text files |
Calculations
High level matrix calculations
This function can be called inside a mario.Database object to call missing matrices for different scenarios.
|
Calculates the input-output matrices for different scenarios. |
|
Return the value of the GDP based scenario. |
|
Calculates the linkages in different modes |
Low level matrix calculations
This functions are used to calculate the matrices in mario.Database while they can be used independently outside a mario.Databases object.
|
Calculates the production vector |
|
Calculates Production vector from Leontief coefficients matrix |
|
Calculates Production vector from Intersectoral transaction coefficients matrix |
|
Calculates Intersectoral transaction flows matrix |
|
Calculates satellite transaction flows matrix |
|
Calculates Factor of production transaction flows matrix |
|
Calculates Economic impact matrix |
|
Calculates Footprint flows matrix |
|
Calculates Intersectoral transaction coefficients matrix |
|
Calculates Factor of production transaction coefficients matrix |
|
Calculates Satellite transaction coefficients matrix |
|
Calculates Multipliers coefficients matrix |
|
Calculates Footprint coefficients matrix |
|
Calculates Leontief coefficients matrix |
|
Calculates Ghosh coefficients matrix |
|
Calculates Intersectoral transaction direct-output coefficients matrix (for Ghosh model) |
|
Calculating Price index coefficients vector |
|
Calculates Final demand share coefficients matrix |
Metadata
|
Saves the metadata in different formats |
Returns the whole history of the metadata |
|
|
Adds notes to the meta history |
Test
For having a simple exmaple of mario, load_test can be used.
|
Loads an example of mario.Database |
Directory
When mario needs to save an output of the model, if no path is given, files wil be saved in a default directory with subfolders based on the type of the output. By default, the directory is the working directory but user can change the default directory.
The defualt directory of the database |
Utilities
There are some useful functions in mario that may help the user for different purposes.
|
Searches for specific keywords in a given item |
|
Helps to slice the matrices |
Logging
In case that logging is useful for the user, the following function can be used to set the level of verbosity.
|
Sets the formatted logging level |