arviz.InferenceData.extend — ArviZ dev documentation (original) (raw)

InferenceData.extend(other, join='left', warn_on_custom_groups=False)[source]#

Extend InferenceData with groups from another InferenceData.

Parameters:

otherInferenceData

InferenceData to be added

join{‘left’, ‘right’}, default ‘left’

Defines how the two decide which group to keep when the same group is present in both objects. ‘left’ will discard the group in other whereas ‘right’ will keep the group in other and discard the one in self.

warn_on_custom_groupsbool, default False

Emit a warning when custom groups are present in the InferenceData. “custom group” means any group whose name isn’t defined in InferenceData schema specification

See also

add_groups

Add new groups to InferenceData object.

concat

Concatenate InferenceData objects.

Examples

Take two InferenceData objects, and extend the first with the groups it doesn’t have but are present in the 2nd InferenceData object.

First InferenceData:

import arviz as az idata = az.load_arviz_data("radon")

Second InferenceData:

other_idata = az.load_arviz_data("rugby")

Call the extend method:

idata.extend(other_idata) idata

See how now the first InferenceData has more groups, with the data from the second one, but the groups it originally had have not been modified, even if also present in the second InferenceData.