pyam

Package documentation

genno.compat.pyam.computations.as_pyam(scenario, quantity, replace={}, year_time_dim=None, rename={}, collapse: Optional[Callable] = None, drop: Union[Collection[str], str] = 'auto', unit=None)

Return a pyam.IamDataFrame containing quantity.

Warnings are logged if the arguments result in additional, unhandled columns in the resulting data frame that are not part of the IAMC spec.

Raises

ValueError – If the resulting data frame has duplicate values in the standard IAMC index columns. pyam.IamDataFrame cannot handle this data.

genno.compat.pyam.computations.concat(*args, **kwargs)

Concatenate args, which must all be pyam.IamDataFrame.

genno.compat.pyam.computations.write_report(quantity, path)

Write the report identified by key to the file at path.

If quantity is a pyam.IamDataFrame and path ends with ‘.csv’ or ‘.xlsx’, use pyam methods to write the file to CSV or Excel format, respectively. Otherwise, equivalent to genno.computations.write_report().

genno.compat.pyam.util.clean_units(df: pandas.core.frame.DataFrame, unit=None) → pandas.core.frame.DataFrame

Convert magnitudes and units of df to unit in str.

Raises

ValueError – if there is more than one unit.

genno.compat.pyam.util.collapse(df: pandas.core.frame.DataFrame, columns: Dict[str, str] = {}, sep='|') → pandas.core.frame.DataFrame

Collapse columns into the IAMC columns of df.

genno.compat.pyam.util.drop(df: pandas.core.frame.DataFrame, columns: Union[Collection[str], str]) → pandas.core.frame.DataFrame

Drop columns if given, or all non-IAMC columns.