@@ -7584,11 +7584,10 @@ def _add_numeric_operations(cls):
7584
7584
cls .any = _make_logical_function (
7585
7585
cls , 'any' , name , name2 , axis_descr ,
7586
7586
'Return whether any element is True over requested axis' ,
7587
- nanops .nanany )
7587
+ nanops .nanany , '' , '' )
7588
7588
cls .all = _make_logical_function (
7589
- cls , 'all' , name , name2 , axis_descr ,
7590
- 'Return whether all elements are True over requested axis' ,
7591
- nanops .nanall )
7589
+ cls , 'all' , name , name2 , axis_descr , _all_doc ,
7590
+ nanops .nanall , _all_examples , _all_see_also )
7592
7591
7593
7592
@Substitution (outname = 'mad' ,
7594
7593
desc = "Return the mean absolute deviation of the values "
@@ -7845,25 +7844,78 @@ def _doc_parms(cls):
7845
7844
%(outname)s : %(name1)s or %(name2)s (if level specified)\n """
7846
7845
7847
7846
_bool_doc = """
7848
-
7849
7847
%(desc)s
7850
7848
7851
7849
Parameters
7852
7850
----------
7853
7851
axis : %(axis_descr)s
7854
7852
skipna : boolean, default True
7855
7853
Exclude NA/null values. If an entire row/column is NA, the result
7856
- will be NA
7854
+ will be NA.
7857
7855
level : int or level name, default None
7858
7856
If the axis is a MultiIndex (hierarchical), count along a
7859
- particular level, collapsing into a %(name1)s
7857
+ particular level, collapsing into a %(name1)s.
7860
7858
bool_only : boolean, default None
7861
7859
Include only boolean columns. If None, will attempt to use everything,
7862
7860
then use only boolean data. Not implemented for Series.
7861
+ **kwargs : any, default None
7862
+ Additional keywords have no affect but might be accepted for
7863
+ compatibility with numpy.
7863
7864
7864
7865
Returns
7865
7866
-------
7866
- %(outname)s : %(name1)s or %(name2)s (if level specified)\n """
7867
+ %(outname)s : %(name1)s or %(name2)s (if level specified)
7868
+
7869
+ %(examples)s
7870
+ %(see_also)s"""
7871
+
7872
+ _all_doc = """\
7873
+ Return whether all elements are True over series or dataframe axis.
7874
+
7875
+ Returns True if all elements within a series or along a dataframe
7876
+ axis are non-zero, not-empty or not-False."""
7877
+
7878
+ _all_examples = """\
7879
+ Examples
7880
+ --------
7881
+ Series
7882
+
7883
+ >>> pd.Series([True, True]).all()
7884
+ True
7885
+ >>> pd.Series([True, False]).all()
7886
+ False
7887
+
7888
+ Dataframes
7889
+
7890
+ Create a dataframe from a dictionary.
7891
+
7892
+ >>> df = pd.DataFrame({'col1': [True, True], 'col2': [True, False]})
7893
+ >>> df
7894
+ col1 col2
7895
+ 0 True True
7896
+ 1 True False
7897
+
7898
+ Default behaviour checks if column-wise values all return True.
7899
+
7900
+ >>> df.all()
7901
+ col1 True
7902
+ col2 False
7903
+ dtype: bool
7904
+
7905
+ Adding axis=1 argument will check if row-wise values all return True.
7906
+
7907
+ >>> df.all(axis=1)
7908
+ 0 True
7909
+ 1 False
7910
+ dtype: bool
7911
+ """
7912
+
7913
+ _all_see_also = """\
7914
+ See also
7915
+ --------
7916
+ pandas.Series.all : Return True if all elements are True
7917
+ pandas.DataFrame.any : Return True if one (or more) elements are True
7918
+ """
7867
7919
7868
7920
_cnum_doc = """
7869
7921
@@ -8046,9 +8098,10 @@ def cum_func(self, axis=None, skipna=True, *args, **kwargs):
8046
8098
return set_function_name (cum_func , name , cls )
8047
8099
8048
8100
8049
- def _make_logical_function (cls , name , name1 , name2 , axis_descr , desc , f ):
8101
+ def _make_logical_function (cls , name , name1 , name2 , axis_descr , desc , f ,
8102
+ examples , see_also ):
8050
8103
@Substitution (outname = name , desc = desc , name1 = name1 , name2 = name2 ,
8051
- axis_descr = axis_descr )
8104
+ axis_descr = axis_descr , examples = examples , see_also = see_also )
8052
8105
@Appender (_bool_doc )
8053
8106
def logical_func (self , axis = None , bool_only = None , skipna = None , level = None ,
8054
8107
** kwargs ):
0 commit comments