Return the maximum of the values over the requested axis. If you want the *index* of the maximum, use ``idxmax``. This is the equivalent of the ``numpy.ndarray`` method ``argmax``. Parameters ---------- axis : {index (0)} Axis for the fu
(
self,
axis: Axis | None = 0,
skipna: bool = True,
numeric_only: bool = False,
**kwargs,
)
| 7805 | |
| 7806 | @deprecate_nonkeyword_arguments(Pandas4Warning, allowed_args=["self"], name="max") |
| 7807 | def max( |
| 7808 | self, |
| 7809 | axis: Axis | None = 0, |
| 7810 | skipna: bool = True, |
| 7811 | numeric_only: bool = False, |
| 7812 | **kwargs, |
| 7813 | ): |
| 7814 | """ |
| 7815 | Return the maximum of the values over the requested axis. |
| 7816 | |
| 7817 | If you want the *index* of the maximum, use ``idxmax``. |
| 7818 | This is the equivalent of the ``numpy.ndarray`` method ``argmax``. |
| 7819 | |
| 7820 | Parameters |
| 7821 | ---------- |
| 7822 | axis : {index (0)} |
| 7823 | Axis for the function to be applied on. |
| 7824 | For `Series` this parameter is unused and defaults to 0. |
| 7825 | |
| 7826 | For DataFrames, specifying ``axis=None`` will apply the aggregation |
| 7827 | across both axes. |
| 7828 | |
| 7829 | .. versionadded:: 2.0.0 |
| 7830 | |
| 7831 | skipna : bool, default True |
| 7832 | Exclude NA/null values when computing the result. |
| 7833 | numeric_only : bool, default False |
| 7834 | Include only float, int, boolean columns. |
| 7835 | **kwargs |
| 7836 | Additional keyword arguments to be passed to the function. |
| 7837 | |
| 7838 | Returns |
| 7839 | ------- |
| 7840 | scalar or Series (if level specified) |
| 7841 | The maximum of the values in the Series. |
| 7842 | |
| 7843 | See Also |
| 7844 | -------- |
| 7845 | numpy.max : Equivalent numpy function for arrays. |
| 7846 | Series.min : Return the minimum. |
| 7847 | Series.max : Return the maximum. |
| 7848 | Series.idxmin : Return the index of the minimum. |
| 7849 | Series.idxmax : Return the index of the maximum. |
| 7850 | DataFrame.min : Return the minimum over the requested axis. |
| 7851 | DataFrame.max : Return the maximum over the requested axis. |
| 7852 | DataFrame.idxmin : Return the index of the minimum over the requested axis. |
| 7853 | DataFrame.idxmax : Return the index of the maximum over the requested axis. |
| 7854 | |
| 7855 | Examples |
| 7856 | -------- |
| 7857 | >>> idx = pd.MultiIndex.from_arrays( |
| 7858 | ... [["warm", "warm", "cold", "cold"], ["dog", "falcon", "fish", "spider"]], |
| 7859 | ... names=["blooded", "animal"], |
| 7860 | ... ) |
| 7861 | >>> s = pd.Series([4, 2, 0, 8], name="legs", index=idx) |
| 7862 | >>> s |
| 7863 | blooded animal |
| 7864 | warm dog 4 |
no outgoing calls