Aggregate a database
Combine native labels into larger groups, using a workbook or a region mapping.
Choose the mapping first; apply it to a copy while checking the result.
For separate import accounts, mappings also apply to native import-row descriptors belonging to the selected productive sets. Foreign origin descriptors stay outside the endogenous Region set.
Your own groups
Fill the Excel template below. Choose which sets to group.
Regional groups
Use a region mapping or a supported preset such as "continent".
NACE or CPA groups
Prepare a classification aggregation from bundled concordances.
Use a workbook#
1 · Prepare
import mario
db = mario.load_test("IOT")
db.get_aggregation_excel(path="aggregation.xlsx")
Fill the target groups for the sets you want to aggregate.
See a filled example.
2 · Apply
aggregated = db.aggregate(
"aggregation.xlsx", inplace=False, ignore_nan=True,
)
ignore_nan=True allows unfilled labels to remain unaggregated.
Aggregation still checks whether the units can be combined.
3 · Inspect
aggregated.get_index("all")
aggregated.Z
Aggregate known regions without a workbook
On a recognized MRIO such as EXIOBASE:
aggregated = db.aggregate(
io=None, levels="Region", region_aggregation="continent",
inplace=False,
)
Other presets are UNregion, EU, OECD, G7 and G20.
You may also supply a dictionary, Series or DataFrame. Presets require
recognizable region identities; the artificial test-region labels do not
represent real countries.
For parameters and mapping layouts see db.aggregate().