Exiobase3 parser
Parsing the exiobase data¶
In this example, parsing exiobase3, data search, slicing and bubble plots are examined.
In [1]:
from mario import parse_exiobase_3,slicer
In [2]:
# database path in local storage
path = r'IOT_2021_ixi.zip'
In [3]:
version = '3.8.1' # by defualt, version 3.8.2 will be parsed which there are minor differences
In [4]:
world = parse_exiobase_3(
path= path,
version= version,
)
In [5]:
# checking the regions and sectors
world.get_index('Region')
Out[5]:
['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']
In [6]:
world.get_index('Sector')
Out[6]:
['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']
In [7]:
# sliceing production matrix of the electricity sector for Italy using slicer and search funcition
# search
elect_sectors = world.search(item='Sector',search='electricity')
In [8]:
# 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']
In [9]:
# using slicer to slice data
X_rows = slicer(matrix='X',axis=0,Region=['IT'],Item=elect_sectors)
In [10]:
# printing the sliced matrix
world.X.loc[X_rows]
Out[10]:
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 |
In [11]:
# aggregating the database
aggregation_path = r'aggregation.xlsx'
world.aggregate(io=aggregation_path)
In [12]:
# 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.
Out[12]:
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
In [13]:
# using bubble plot for visualization
world.plot_bubble(x='CO2', y='Employment', size='GDP',path='bubble_plot.html')