pymrio.calc_gross_trade

pymrio.calc_gross_trade(Z: DataFrame, Y: DataFrame) gross_trade

Calculate the gross bilateral trade flows and totals.

These are the entries of Z and Y with the domestic blocks set to 0.

Notes

This only works for DataFrame representation of Z and Y following the standard pymrio structure (regions on Multiindex level 0 or named ‘region’, sectors/categories on Multiindex level 1 or named ‘sector’).

Parameters
  • Z (pandas.DataFrame) – Symmetric input output table (flows)

  • Y (pandas.DataFrame) – final demand with regions (multiindex level 1) and categories (level 2)

Returns

A NamedTuple with two fields:

  • bilat_flows: df with rows: exporting country and sector, columns: importing countries

  • totals: df with gross total imports and exports per sector and region

Return type

namedtuple (with two DataFrames)