xray.Dataset.merge

Dataset.merge(other, inplace=False, overwrite_vars=set([]), compat='equals')

Merge the arrays of two datasets into a single dataset.

This method generally not allow for overriding data, with the exception of attributes, which are ignored on the second dataset. Variables with the same name are checked for conflicts via the equals or identical methods.

Parameters:

other : Dataset or castable to Dataset

Dataset or variables to merge with this dataset.

inplace : bool, optional

If True, merge the other dataset into this dataset in-place. Otherwise, return a new dataset object.

overwrite_vars : str or sequence, optional

If provided, update variables of these name(s) without checking for conflicts in this dataset.

compat : {‘equals’, ‘identical’}, optional

String indicating how to compare variables of the same name for potential conflicts. ‘equals’ means that all values and dimensions must be the same; ‘identical’ means attributes must also be equal.

Returns:

merged : Dataset

Merged dataset.

Raises:

ValueError

If any variables conflict (see compat).