pymrio.parse_exio12_ext

pymrio.parse_exio12_ext(ext_file, index_col, name, drop_compartment=True, version=None, year=None, iosystem=None, sep=', ')

Parse an EXIOBASE version 1 or 2 like extension file into pymrio.Extension

EXIOBASE like extensions files are assumed to have two rows which are used as columns multiindex (region and sector) and up to three columns for the row index (see Parameters).

For EXIOBASE 3 - extension can be loaded directly with pymrio.load

Notes

So far this only parses factor of production extensions F (not final demand extensions F_Y nor coeffiecents S).

Parameters:
  • ext_file (string or pathlib.Path) – File to parse
  • index_col (int) – The number of columns (1 to 3) at the beginning of the file to use as the index. The order of the index_col must be - 1 index column: [‘stressor’] - 2 index columns: [‘stressor’, ‘unit’] - 3 index columns: [‘stressor’, ‘compartment’, ‘unit’] - > 3: everything up to three index columns will be removed
  • name (string) – Name of the extension
  • drop_compartment (boolean, optional) – If True (default) removes the compartment from the index.
  • version (string, optional) – see pymrio.Extension
  • iosystem (string, optional) – see pymrio.Extension
  • year (string or int) – see pymrio.Extension
  • sep (string, optional) – Delimiter to use; default ‘,’
Returns:

with F (and unit if available)

Return type:

pymrio.Extension