xray.DataArray.reindex_like

DataArray.reindex_like(other, copy=True)

Conform this object onto the coordinates of another object, filling in missing values with NaN.

Parameters:

other : Dataset or DataArray

Object with a coordinates attribute giving a mapping from dimension names to xray.Coordinate objects, which provides indexes upon which to index the variables in this dataset. The coordinates on this other object need not be the same as the coordinates on this dataset. Any mis-matched coordinate values will be filled in with NaN, and any mis-matched dimension names will simply be ignored.

copy : bool, optional

If copy=True, the returned array’s dataset contains only copied variables. If copy=False and no reindexing is required then original variables from this array’s dataset are returned.

Returns:

reindexed : DataArray

Another dataset array, with this array’s data but coordinates from the other object.