diff --git a/pandas-stubs/core/frame.pyi b/pandas-stubs/core/frame.pyi index 3c5b2010b..1a91f717c 100644 --- a/pandas-stubs/core/frame.pyi +++ b/pandas-stubs/core/frame.pyi @@ -2344,9 +2344,18 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): axis: Axis | None = ..., level: Level | None = None, ) -> Self: ... + @overload def max( self, - axis: Axis | None = 0, + axis: None, + skipna: _bool | None = True, + numeric_only: _bool = False, + **kwargs: Any, + ) -> Scalar: ... + @overload + def max( + self, + axis: Axis = 0, skipna: _bool | None = True, numeric_only: _bool = False, **kwargs: Any, diff --git a/tests/test_frame.py b/tests/test_frame.py index 521d4b896..e52d53c58 100644 --- a/tests/test_frame.py +++ b/tests/test_frame.py @@ -826,6 +826,7 @@ def test_types_max() -> None: df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]}) check(assert_type(df.max(), pd.Series), pd.Series) check(assert_type(df.max(axis=0), pd.Series), pd.Series) + check(assert_type(df.max(axis=None), Scalar), np.int64) def test_types_quantile() -> None: