Skip to content

Commit 030cf5d

Browse files
authored
BUG: Change default of bool_only to False (#53283)
1 parent 1ac7815 commit 030cf5d

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

doc/source/whatsnew/v2.1.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ Numeric
341341
- Bug in :meth:`Series.mean`, :meth:`DataFrame.mean` with object-dtype values containing strings that can be converted to numbers (e.g. "2") returning incorrect numeric results; these now raise ``TypeError`` (:issue:`36703`, :issue:`44008`)
342342
- Bug in :meth:`DataFrame.corrwith` raising ``NotImplementedError`` for pyarrow-backed dtypes (:issue:`52314`)
343343
- Bug in :meth:`DataFrame.size` and :meth:`Series.size` returning 64-bit integer instead of int (:issue:`52897`)
344+
- Bug in :meth:`Series.any`, :meth:`Series.all`, :meth:`DataFrame.any`, and :meth:`DataFrame.all` had the default value of ``bool_only`` set to ``None`` instead of ``False``; this change should have no impact on users (:issue:`53258`)
344345
- Bug in :meth:`Series.corr` and :meth:`Series.cov` raising ``AttributeError`` for masked dtypes (:issue:`51422`)
345346
- Bug in :meth:`Series.median` and :meth:`DataFrame.median` with object-dtype values containing strings that can be converted to numbers (e.g. "2") returning incorrect numeric results; these now raise ``TypeError`` (:issue:`34671`)
346-
-
347347

348348

349349
Conversion

pandas/core/frame.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10957,7 +10957,7 @@ def any( # type: ignore[override]
1095710957
self,
1095810958
*,
1095910959
axis: Axis = 0,
10960-
bool_only=None,
10960+
bool_only: bool = False,
1096110961
skipna: bool = True,
1096210962
**kwargs,
1096310963
) -> Series:
@@ -10971,7 +10971,7 @@ def any( # type: ignore[override]
1097110971
def all(
1097210972
self,
1097310973
axis: Axis = 0,
10974-
bool_only=None,
10974+
bool_only: bool = False,
1097510975
skipna: bool = True,
1097610976
**kwargs,
1097710977
) -> Series:

pandas/core/generic.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -12035,9 +12035,8 @@ def last_valid_index(self) -> Hashable | None:
1203512035
original index.
1203612036
* None : reduce all axes, return a scalar.
1203712037
12038-
bool_only : bool, default None
12039-
Include only boolean columns. If None, will attempt to use everything,
12040-
then use only boolean data. Not implemented for Series.
12038+
bool_only : bool, default False
12039+
Include only boolean columns. Not implemented for Series.
1204112040
skipna : bool, default True
1204212041
Exclude NA/null values. If the entire row/column is NA and skipna is
1204312042
True, then the result will be {empty_value}, as for an empty row/column.

pandas/core/series.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5943,7 +5943,7 @@ def any( # type: ignore[override]
59435943
self,
59445944
*,
59455945
axis: Axis = 0,
5946-
bool_only=None,
5946+
bool_only: bool = False,
59475947
skipna: bool = True,
59485948
**kwargs,
59495949
) -> bool:
@@ -5962,7 +5962,7 @@ def any( # type: ignore[override]
59625962
def all(
59635963
self,
59645964
axis: Axis = 0,
5965-
bool_only=None,
5965+
bool_only: bool = False,
59665966
skipna: bool = True,
59675967
**kwargs,
59685968
) -> bool:

0 commit comments

Comments
 (0)