xray.auto_combine

xray.auto_combine(datasets, concat_dim=None)

Attempt to auto-magically combine the given datasets into one.

This method attempts to combine a list of datasets into a single entity by inspecting metadata and using a combination of concat and merge.

It does not concatenate along more than one dimension or align or sort data under any circumstances. It will fail in complex cases, for which you should use concat and merge explicitly.

Example of when auto_combine works:

  • You have N years of data and M data variables. Each combination of a distinct time period and test of data variables is saved its own dataset.

Examples of when auto_combine fails:

  • In the above scenario, one file is missing, containing the data for one year’s data for one variable.
  • In the most recent year, there is an additional data variable.
  • Your data includes “time” and “station” dimensions, and each year’s data has a different set of stations.
Parameters:

datasets : sequence of xray.Dataset

Dataset objects to merge.

concat_dim : str or DataArray or Index, optional

Dimension along which to concatenate variables.

Returns:

combined : xray.Dataset

See also

concat, Dataset.merge