@@ -9862,10 +9862,10 @@ def _add_numeric_operations(cls):
9862
9862
axis_descr , name , name2 = _doc_parms (cls )
9863
9863
9864
9864
cls .any = _make_logical_function (
9865
- cls , 'any' , name , name2 , axis_descr ,
9865
+ cls , 'any' , name , name2 , False , axis_descr ,
9866
9866
_any_desc , nanops .nanany , _any_examples , _any_see_also )
9867
9867
cls .all = _make_logical_function (
9868
- cls , 'all' , name , name2 , axis_descr , _all_doc ,
9868
+ cls , 'all' , name , name2 , True , axis_descr , _all_doc ,
9869
9869
nanops .nanall , _all_examples , _all_see_also )
9870
9870
9871
9871
@Substitution (outname = 'mad' ,
@@ -10188,8 +10188,10 @@ def _doc_parms(cls):
10188
10188
Include only boolean columns. If None, will attempt to use everything,
10189
10189
then use only boolean data. Not implemented for Series.
10190
10190
skipna : boolean, default True
10191
- Exclude NA/null values. If an entire row/column is NA, the result
10192
- will be NA.
10191
+ Exclude NA/null values. If the entire row/column is NA and skipna is
10192
+ True, then the result will be %(empty_value)s, as for an empty row/column.
10193
+ If skipna is False, then NA are treated as True, because these are not
10194
+ equal to zero.
10193
10195
level : int or level name, default None
10194
10196
If the axis is a MultiIndex (hierarchical), count along a
10195
10197
particular level, collapsing into a %(name1)s.
@@ -10219,6 +10221,10 @@ def _doc_parms(cls):
10219
10221
True
10220
10222
>>> pd.Series([True, False]).all()
10221
10223
False
10224
+ >>> pd.Series([]).all()
10225
+ True
10226
+ >>> pd.Series([np.nan]).all()
10227
+ True
10222
10228
10223
10229
DataFrames
10224
10230
@@ -10576,6 +10582,13 @@ def _doc_parms(cls):
10576
10582
10577
10583
>>> pd.Series([True, False]).any()
10578
10584
True
10585
+ >>> pd.Series([]).any()
10586
+ False
10587
+ >>> pd.Series([np.nan]).any()
10588
+ False
10589
+ >>> pd.Series([np.nan]).any(skipna=False)
10590
+ True
10591
+
10579
10592
10580
10593
**DataFrame**
10581
10594
@@ -10860,9 +10873,9 @@ def cum_func(self, axis=None, skipna=True, *args, **kwargs):
10860
10873
return set_function_name (cum_func , name , cls )
10861
10874
10862
10875
10863
- def _make_logical_function (cls , name , name1 , name2 , axis_descr , desc , f ,
10876
+ def _make_logical_function (cls , name , name1 , name2 , empty_value , axis_descr , desc , f ,
10864
10877
examples , see_also ):
10865
- @Substitution (outname = name , desc = desc , name1 = name1 , name2 = name2 ,
10878
+ @Substitution (outname = name , desc = desc , name1 = name1 , name2 = name2 , empty_value = empty_value ,
10866
10879
axis_descr = axis_descr , examples = examples , see_also = see_also )
10867
10880
@Appender (_bool_doc )
10868
10881
def logical_func (self , axis = 0 , bool_only = None , skipna = True , level = None ,
0 commit comments