mario.Database.to_single_region#
- Database.to_single_region(region, inplace=True, trade_mode='aggregate')#
Extract one region from a multi-regional database.
- Parameters:
region – Region label to keep.
inplace – When
True, mutate the current database. WhenFalse, return a transformed copy.trade_mode –
"aggregate"collapses all excluded regions into aggregated imports and export categories."by_region"keeps one explicit import row and one explicit export category per excluded region.
- Returns:
Single-region database when
inplace=False, otherwiseNone.- Return type:
Database | None
Notes
This is a convenience wrapper around
to_region_subset([region], ...). Useto_region_subset(...)when you need to keep more than one region explicit while externalizing the rest of the world.