Skip to content

Commit 71e969f

Browse files
authored
CLN/depr: NDFrame.bool (#52802)
1 parent bcd5d25 commit 71e969f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pandas/core/generic.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,10 @@ def bool(self) -> bool_t:
14741474
"""
14751475
Return the bool of a single element Series or DataFrame.
14761476
1477+
.. deprecated:: 2.1.0
1478+
1479+
bool is deprecated and will be removed in future version of pandas
1480+
14771481
This must be a boolean scalar value, either True or False. It will raise a
14781482
ValueError if the Series or DataFrame does not have exactly 1 element, or that
14791483
element is not boolean (integer values 0 and 1 will also raise an exception).
@@ -1493,14 +1497,14 @@ def bool(self) -> bool_t:
14931497
--------
14941498
The method will only work for single element objects with a boolean value:
14951499
1496-
>>> pd.Series([True]).bool()
1500+
>>> pd.Series([True]).bool() # doctest: +SKIP
14971501
True
1498-
>>> pd.Series([False]).bool()
1502+
>>> pd.Series([False]).bool() # doctest: +SKIP
14991503
False
15001504
1501-
>>> pd.DataFrame({'col': [True]}).bool()
1505+
>>> pd.DataFrame({'col': [True]}).bool() # doctest: +SKIP
15021506
True
1503-
>>> pd.DataFrame({'col': [False]}).bool()
1507+
>>> pd.DataFrame({'col': [False]}).bool() # doctest: +SKIP
15041508
False
15051509
"""
15061510

0 commit comments

Comments
 (0)