diff --git a/pandas/core/frame.py b/pandas/core/frame.py index ef5e6dd1d6757..bc190257a1cdd 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8988,6 +8988,42 @@ def aggregate(self, func=None, axis: Axis = 0, *args, **kwargs): agg = aggregate + # error: Signature of "any" incompatible with supertype "NDFrame" [override] + @overload # type: ignore[override] + def any( + self, + *, + axis: Axis = ..., + bool_only: bool | None = ..., + skipna: bool = ..., + level: None = ..., + **kwargs, + ) -> Series: + ... + + @overload + def any( + self, + *, + axis: Axis = ..., + bool_only: bool | None = ..., + skipna: bool = ..., + level: Level, + **kwargs, + ) -> DataFrame | Series: + ... + + @doc(NDFrame.any, **_shared_doc_kwargs) + def any( + self, + axis: Axis = 0, + bool_only: bool | None = None, + skipna: bool = True, + level: Level | None = None, + **kwargs, + ) -> DataFrame | Series: + ... + @doc( _shared_docs["transform"], klass=_shared_doc_kwargs["klass"], diff --git a/pandas/core/series.py b/pandas/core/series.py index 1d3509cac0edd..b740bac78b263 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -4397,6 +4397,42 @@ def aggregate(self, func=None, axis=0, *args, **kwargs): agg = aggregate + # error: Signature of "any" incompatible with supertype "NDFrame" [override] + @overload # type: ignore[override] + def any( + self, + *, + axis: Axis = ..., + bool_only: bool | None = ..., + skipna: bool = ..., + level: None = ..., + **kwargs, + ) -> bool: + ... + + @overload + def any( + self, + *, + axis: Axis = ..., + bool_only: bool | None = ..., + skipna: bool = ..., + level: Level, + **kwargs, + ) -> Series | bool: + ... + + @doc(NDFrame.any, **_shared_doc_kwargs) + def any( + self, + axis: Axis = 0, + bool_only: bool | None = None, + skipna: bool = True, + level: Level | None = None, + **kwargs, + ) -> Series | bool: + ... + @doc( _shared_docs["transform"], klass=_shared_doc_kwargs["klass"],