Skip to content
36 changes: 36 additions & 0 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
36 changes: 36 additions & 0 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down