zeros_ref

xarray_einstats.zeros_ref(*args, dims, dtype=None)[source]

Create a zeros DataArray from reference object(s).

Creates a DataArray filled with zeros from reference DataArrays or Datasets and a list with the desired dimensions.

Parameters:
*argsiterable of xarray.DataArray or xarray.Dataset

Reference objects from which the lengths and coordinate values (if any) of the given dims will be taken.

dimslist of hashable

List of dimensions of the output DataArray. Passed as is to the {class}`~xarray.DataArray` constructor.

dtypedtype, optional

The dtype of the output array. If it is not provided it will be inferred from the reference DataArrays in args with numpy.result_type.

Returns:
xarray.DataArray

See also

ones_ref, empty_ref