xray.DataArray.concat

classmethod DataArray.concat(arrays, dimension='concat_dimension', indexers=None, concat_over=None)

Stack arrays along a new or existing dimension to form a new DataArray.

Parameters:

arrays : iterable of DataArray

Arrays to stack together. Each variable is expected to have matching dimensions and shape except for along the concatenated dimension.

dimension : str or Array, optional

Name of the dimension to stack along. This can either be a new dimension name, in which case it is added along axis=0, or an existing dimension name, in which case the location of the dimension is unchanged. Where to insert the new dimension is determined by whether it is found in the first array. If dimension is provided as an Variable or DataArray, the name of the dataset array or the singleton dimension of the variable is used as the stacking dimension and the array is added to the returned dataset.

indexers : iterable of indexers, optional

Iterable of indexers of the same length as variables which specifies how to assign variables along the given dimension. If not supplied, indexers is inferred from the length of each variable along the dimension, and the variables are concatenated in the given order.

concat_over : None or str or iterable of str, optional

Names of additional variables to concatenate (other than the given arrays variables), in which “dimension” does not already appear as a dimension.

Returns:

concatenated : DataArray

Concatenated DataArray formed by concatenated all the supplied variables along the new dimension.

See also

Dataset.concat