Return the minimum value of the Index. Parameters ---------- axis : {None} Dummy argument for consistency with Series. skipna : bool, default True Exclude NA/null values when showing the result. *args, **kwargs Add
(self, axis: AxisInt | None = None, skipna: bool = True, *args, **kwargs)
| 7681 | return super().argmax(skipna=skipna) |
| 7682 | |
| 7683 | def min(self, axis: AxisInt | None = None, skipna: bool = True, *args, **kwargs): |
| 7684 | """ |
| 7685 | Return the minimum value of the Index. |
| 7686 | |
| 7687 | Parameters |
| 7688 | ---------- |
| 7689 | axis : {None} |
| 7690 | Dummy argument for consistency with Series. |
| 7691 | skipna : bool, default True |
| 7692 | Exclude NA/null values when showing the result. |
| 7693 | *args, **kwargs |
| 7694 | Additional arguments and keywords for compatibility with NumPy. |
| 7695 | |
| 7696 | Returns |
| 7697 | ------- |
| 7698 | scalar |
| 7699 | Minimum value. |
| 7700 | |
| 7701 | See Also |
| 7702 | -------- |
| 7703 | Index.max : Return the maximum value of the object. |
| 7704 | Series.min : Return the minimum value in a Series. |
| 7705 | DataFrame.min : Return the minimum values in a DataFrame. |
| 7706 | |
| 7707 | Examples |
| 7708 | -------- |
| 7709 | >>> idx = pd.Index([3, 2, 1]) |
| 7710 | >>> idx.min() |
| 7711 | 1 |
| 7712 | |
| 7713 | >>> idx = pd.Index(["c", "b", "a"]) |
| 7714 | >>> idx.min() |
| 7715 | 'a' |
| 7716 | |
| 7717 | For a MultiIndex, the minimum is determined lexicographically. |
| 7718 | |
| 7719 | >>> idx = pd.MultiIndex.from_product([("a", "b"), (2, 1)]) |
| 7720 | >>> idx.min() |
| 7721 | ('a', 1) |
| 7722 | """ |
| 7723 | nv.validate_min(args, kwargs) |
| 7724 | nv.validate_minmax_axis(axis) |
| 7725 | |
| 7726 | if not len(self): |
| 7727 | return self._na_value |
| 7728 | |
| 7729 | if len(self) and self.is_monotonic_increasing: |
| 7730 | # quick check |
| 7731 | first = self[0] |
| 7732 | if not isna(first): |
| 7733 | return maybe_unbox_numpy_scalar(first) |
| 7734 | |
| 7735 | if not self._is_multi and self.hasnans: |
| 7736 | # Take advantage of cache |
| 7737 | mask = self._isnan |
| 7738 | if not skipna or mask.all(): |
| 7739 | return self._na_value |
| 7740 |
no test coverage detected