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

Method argmin

xarray/core/variable.py:2558–2601  ·  view source on GitHub ↗

Index or indices of the minimum of the Variable over one or more dimensions. If a sequence is passed to 'dim', then result returned as dict of Variables, which can be passed directly to isel(). If a single str is passed to 'dim' then returns a Variable with dtype int.

(
        self,
        dim: Dims = None,
        axis: int | None = None,
        keep_attrs: bool | None = None,
        skipna: bool | None = None,
    )

Source from the content-addressed store, hash-verified

2556 return result
2557
2558 def argmin(
2559 self,
2560 dim: Dims = None,
2561 axis: int | None = None,
2562 keep_attrs: bool | None = None,
2563 skipna: bool | None = None,
2564 ) -> Variable | dict[Hashable, Variable]:
2565 """Index or indices of the minimum of the Variable over one or more dimensions.
2566 If a sequence is passed to 'dim', then result returned as dict of Variables,
2567 which can be passed directly to isel(). If a single str is passed to 'dim' then
2568 returns a Variable with dtype int.
2569
2570 If there are multiple minima, the indices of the first one found will be
2571 returned.
2572
2573 Parameters
2574 ----------
2575 dim : "...", str, Iterable of Hashable or None, optional
2576 The dimensions over which to find the minimum. By default, finds minimum over
2577 all dimensions - for now returning an int for backward compatibility, but
2578 this is deprecated, in future will return a dict with indices for all
2579 dimensions; to return a dict with all dimensions now, pass '...'.
2580 axis : int, optional
2581 Axis over which to apply `argmin`. Only one of the 'dim' and 'axis' arguments
2582 can be supplied.
2583 keep_attrs : bool, optional
2584 If True, the attributes (`attrs`) will be copied from the original
2585 object to the new one. If False (default), the new object will be
2586 returned without attributes.
2587 skipna : bool, optional
2588 If True, skip missing values (as marked by NaN). By default, only
2589 skips missing values for float dtypes; other dtypes either do not
2590 have a sentinel missing value (int) or skipna=True has not been
2591 implemented (object, datetime64 or timedelta64).
2592
2593 Returns
2594 -------
2595 result : Variable or dict of Variable
2596
2597 See Also
2598 --------
2599 DataArray.argmin, DataArray.idxmin
2600 """
2601 return self._unravel_argminmax("argmin", dim, axis, keep_attrs, skipna)
2602
2603 def argmax(
2604 self,

Callers

nothing calls this directly

Calls 1

_unravel_argminmaxMethod · 0.95

Tested by

no test coverage detected