xray.Dataset.reindex¶
- Dataset.reindex(indexers=None, method=None, copy=True, **kw_indexers)¶
Conform this object onto a new set of indexes, filling in missing values with NaN.
Parameters: indexers : dict. optional
Dictionary with keys given by dimension names and values given by arrays of coordinates tick labels. Any mis-matched coordinate values will be filled in with NaN, and any mis-matched dimension names will simply be ignored.
method : {None, ‘nearest’, ‘pad’/’ffill’, ‘backfill’/’bfill’}, optional
Method to use for filling index values in indexers not found in this dataset:
- None (default): don’t fill gaps
- pad / ffill: propgate last valid index value forward
- backfill / bfill: propagate next valid index value backward
- nearest: use nearest valid index value (requires pandas>=0.16)
copy : bool, optional
If copy=True, the returned dataset contains only copied variables. If copy=False and no reindexing is required then original variables from this dataset are returned.
**kw_indexers : optional
Keyword arguments in the same form as indexers.
Returns: reindexed : Dataset
Another dataset, with this dataset’s data but replaced coordinates.
See also