Index or indices of the maximum 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,
)
| 2601 | return self._unravel_argminmax("argmin", dim, axis, keep_attrs, skipna) |
| 2602 | |
| 2603 | def argmax( |
| 2604 | self, |
| 2605 | dim: Dims = None, |
| 2606 | axis: int | None = None, |
| 2607 | keep_attrs: bool | None = None, |
| 2608 | skipna: bool | None = None, |
| 2609 | ) -> Variable | dict[Hashable, Variable]: |
| 2610 | """Index or indices of the maximum of the Variable over one or more dimensions. |
| 2611 | If a sequence is passed to 'dim', then result returned as dict of Variables, |
| 2612 | which can be passed directly to isel(). If a single str is passed to 'dim' then |
| 2613 | returns a Variable with dtype int. |
| 2614 | |
| 2615 | If there are multiple maxima, the indices of the first one found will be |
| 2616 | returned. |
| 2617 | |
| 2618 | Parameters |
| 2619 | ---------- |
| 2620 | dim : "...", str, Iterable of Hashable or None, optional |
| 2621 | The dimensions over which to find the maximum. By default, finds maximum over |
| 2622 | all dimensions - for now returning an int for backward compatibility, but |
| 2623 | this is deprecated, in future will return a dict with indices for all |
| 2624 | dimensions; to return a dict with all dimensions now, pass '...'. |
| 2625 | axis : int, optional |
| 2626 | Axis over which to apply `argmin`. Only one of the 'dim' and 'axis' arguments |
| 2627 | can be supplied. |
| 2628 | keep_attrs : bool, optional |
| 2629 | If True, the attributes (`attrs`) will be copied from the original |
| 2630 | object to the new one. If False (default), the new object will be |
| 2631 | returned without attributes. |
| 2632 | skipna : bool, optional |
| 2633 | If True, skip missing values (as marked by NaN). By default, only |
| 2634 | skips missing values for float dtypes; other dtypes either do not |
| 2635 | have a sentinel missing value (int) or skipna=True has not been |
| 2636 | implemented (object, datetime64 or timedelta64). |
| 2637 | |
| 2638 | Returns |
| 2639 | ------- |
| 2640 | result : Variable or dict of Variable |
| 2641 | |
| 2642 | See Also |
| 2643 | -------- |
| 2644 | DataArray.argmax, DataArray.idxmax |
| 2645 | """ |
| 2646 | return self._unravel_argminmax("argmax", dim, axis, keep_attrs, skipna) |
| 2647 | |
| 2648 | def _as_sparse(self, sparse_format=_default, fill_value=_default) -> Variable: |
| 2649 | """ |