General functions

pyam.concat(objs, ignore_meta_conflict=False, **kwargs)[source]

Concatenate a series of IamDataFrame-like objects

Parameters
objsiterable of IamDataFrames

A list of objects castable to IamDataFrame

ignore_meta_conflictbool, optional

If False, raise an error if any meta columns present in dfs are not identical. If True, values in earlier elements of dfs take precedence.

kwargs

Passed to IamDataFrame(other, **kwargs) for any item of dfs which isn’t already an IamDataFrame.

Returns
IamDataFrame
Raises
TypeError

If dfs is not a list.

ValueError

If time domain or other timeseries data index dimension don’t match.

Notes

The meta attributes are merged only for those objects of objs that are passed as IamDataFrame instances.

pyam.compare(left, right, left_label='left', right_label='right', drop_close=True, **kwargs)[source]

Compare the data in two IamDataFrames and return a pandas.DataFrame

Parameters
left, rightIamDataFrames

two IamDataFrame instances to be compared

left_label, right_labelstr, default left, right

column names of the returned pandas.DataFrame

drop_closebool, optional

remove all data where left and right are close

kwargsarguments for comparison of values

passed to numpy.isclose()

pyam.require_variable(df, variable, unit=None, year=None, exclude_on_fail=False, **kwargs)[source]

Check whether all scenarios have a required variable

Parameters
dfIamDataFrame
argspassed to IamDataFrame.require_variable()
kwargsused for downselecting IamDataFrame

passed to IamDataFrame.filter()

pyam.validate(df, criteria={}, exclude_on_fail=False, **kwargs)[source]

Validate scenarios using criteria on timeseries values

Returns all scenarios which do not match the criteria and prints a log message or returns None if all scenarios match the criteria.

When called with exclude_on_fail=True, scenarios in df not satisfying the criteria will be marked as exclude=True (object modified in place).

Parameters
dfIamDataFrame
argspassed to IamDataFrame.validate()
kwargsused for downselecting IamDataFrame

passed to IamDataFrame.filter()

pyam.categorize(df, name, value, criteria, color=None, marker=None, linestyle=None, **kwargs)[source]

Assign scenarios to a category according to specific criteria or display the category assignment

Parameters
dfIamDataFrame
argspassed to IamDataFrame.categorize()
kwargsused for downselecting IamDataFrame

passed to IamDataFrame.filter()

pyam.check_aggregate(df, variable, components=None, exclude_on_fail=False, multiplier=1, **kwargs)[source]

Check whether the timeseries values match the aggregation of sub-categories

Parameters
dfIamDataFrame
argspassed to IamDataFrame.check_aggregate()
kwargsused for downselecting IamDataFrame

passed to IamDataFrame.filter()