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

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.


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 : {‘broadcast_equals’, ‘equals’, ‘identical’}, optional

String indicating how to compare variables of the same name for potential conflicts:

  • ‘broadcast_equals’: all values must be equal when variables are broadcast against each other to ensure common dimensions.
  • ‘equals’: all values and dimensions must be the same.
  • ‘identical’: all values, dimensions and attributes must be the same.

join : {‘outer’, ‘inner’, ‘left’, ‘right’}, optional

Method for joining self and other along shared dimensions:

  • ‘outer’: use the union of the indexes
  • ‘inner’: use the intersection of the indexes
  • ‘left’: use indexes from self
  • ‘right’: use indexes from other

merged : Dataset

Merged dataset.



If any variables conflict (see compat).