MCPcopy Index your code
hub / github.com/pydata/xarray / reindex_like

Method reindex_like

xarray/core/dataarray.py:1989–2173  ·  view source on GitHub ↗

Conform this object onto the indexes of another object, for indexes which the objects share. Missing values are filled with ``fill_value``. The default fill value is NaN. Parameters ---------- other : Dataset or DataArray Object with an '

(
        self,
        other: T_DataArrayOrSet,
        *,
        method: ReindexMethodOptions = None,
        tolerance: float | Iterable[float] | str | None = None,
        copy: bool = True,
        fill_value=dtypes.NA,
    )

Source from the content-addressed store, hash-verified

1987 return da
1988
1989 def reindex_like(
1990 self,
1991 other: T_DataArrayOrSet,
1992 *,
1993 method: ReindexMethodOptions = None,
1994 tolerance: float | Iterable[float] | str | None = None,
1995 copy: bool = True,
1996 fill_value=dtypes.NA,
1997 ) -> Self:
1998 """
1999 Conform this object onto the indexes of another object, for indexes which the
2000 objects share. Missing values are filled with ``fill_value``. The default fill
2001 value is NaN.
2002
2003 Parameters
2004 ----------
2005 other : Dataset or DataArray
2006 Object with an 'indexes' attribute giving a mapping from dimension
2007 names to pandas.Index objects, which provides coordinates upon
2008 which to index the variables in this dataset. The indexes on this
2009 other object need not be the same as the indexes on this
2010 dataset. Any mismatched index values will be filled in with
2011 NaN, and any mismatched dimension names will simply be ignored.
2012 method : {None, "nearest", "pad", "ffill", "backfill", "bfill"}, optional
2013 Method to use for filling index values from other not found on this
2014 data array:
2015
2016 - None (default): don't fill gaps
2017 - pad / ffill: propagate last valid index value forward
2018 - backfill / bfill: propagate next valid index value backward
2019 - nearest: use nearest valid index value
2020
2021 tolerance : float | Iterable[float] | str | None, default: None
2022 Maximum distance between original and new labels for inexact
2023 matches. The values of the index at the matching locations must
2024 satisfy the equation ``abs(index[indexer] - target) <= tolerance``.
2025 Tolerance may be a scalar value, which applies the same tolerance
2026 to all values, or list-like, which applies variable tolerance per
2027 element. List-like must be the same size as the index and its dtype
2028 must exactly match the index’s type.
2029 copy : bool, default: True
2030 If ``copy=True``, data in the return value is always copied. If
2031 ``copy=False`` and reindexing is unnecessary, or can be performed
2032 with only slice operations, then the output may share memory with
2033 the input. In either case, a new xarray object is always returned.
2034 fill_value : scalar or dict-like, optional
2035 Value to use for newly missing values. If a dict-like, maps
2036 variable names (including coordinates) to fill values. Use this
2037 data array's name to refer to the data array's values.
2038
2039 Returns
2040 -------
2041 reindexed : DataArray
2042 Another dataset array, with this array&#x27;s data but coordinates from
2043 the other object.
2044
2045 Examples
2046 --------

Callers 4

test_reindex_likeMethod · 0.95
test_reindex_methodMethod · 0.95

Calls

no outgoing calls

Tested by 4

test_reindex_likeMethod · 0.76
test_reindex_methodMethod · 0.76