Closed
Description
It would be nice to be able to specify a custom fill value other than NaN for alignment/reindexing, e.g.,
>>> xr.DataArray([0, 0], [('x', [1, 2])]).reindex(x=[0, 1, 2, 3], fill_value=-1)
<xarray.DataArray (x: 4)>
array([-1, 0, 0, -1])
Coordinates:
* x (x) int64 1 2 3 4
This should be pretty straightforward, simplify a matter of adding a fill_value
keyword argument to the various interfaces and passing it on to Variable.__getitem_with_mask
inside xarray.core.alignment.reindex_variables()
.