pymrio.extension_characterize
- pymrio.extension_characterize(*extensions, factors, new_extension_name='impacts', extension_col_name='extension', characterized_name_column='impact', characterization_factors_column='factor', characterized_unit_column='impact_unit', only_validation=False, orig_unit_column='stressor_unit')
Characterize stressors across different extensions.
This works similar to the characterize method of a specific extension.
The factors dataframe must include an columns “extension” which specifies the ‘name’ of the extension in which the stressor is present. The ‘name’ is the str returned by ext.name
For more information on the structure of the factors dataframe see the Extension.characterize docstring.
Validation behaviour is consistent with Extension.characterize and the validation is applied to a temporary merged extension with all stressors.
- Parameters
extensions (list of extensions) – Extensions to convert. All extensions passed must have the same index names/format.
factors (pd.DataFrame) – A dataframe in long format with numerical index and columns named index.names of the extension to be characterized and ‘extension’, ‘characterized_name_column’, ‘characterization_factors_column’, ‘characterized_unit_column’, ‘orig_unit_column’
extension_name (str) – The name of the new extension returned
extension_col_name (str, optional) – Name of the column specifying the extension name in df_map. The entry in df_map here can either be the name returned by Extension.name or the name of the Extension instance. Default: ‘extension’
characterized_name_column (str (optional)) – Name of the column with the names of the characterized account (default: “impact”)
characterization_factors_column (str (optional)) – Name of the column with the factors for the characterization (default: “factor”)
characterized_unit_column (str (optional)) – Name of the column with the units of the characterized accounts characterization (default: “impact_unit”)
name (string (optional)) – The new name for the extension, if the string starts with an underscore ‘_’ the string with be appended to the original name. Default: ‘_characterized’
- Return type
pymrio.Extension