-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: update the pandas.DataFrame.all docstring #20216
Merged
jreback
merged 13 commits into
pandas-dev:master
from
mlaforet:pandas_dataframe_all_doc_fix
Mar 11, 2018
Merged
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
68657f4
improved docs for pandas.Dataframe.all
25012e0
Merge remote-tracking branch 'upstream/master' into pandas_dataframe_…
2088c9f
fixed spacing in examples text
75e370e
passes pep8 styling
adacc34
added axis description
ce5a115
readded the axis paramerte reference and added a kwargs
cea3edd
Merge remote-tracking branch 'upstream/master' into pandas_dataframe_…
3347753
made changes requested by core developers
7ebd4da
removed changes from other branches
49da2fc
removed typo
aceed8c
added series.all to see also
af464c8
fixed doc typo
23928f9
Merge branch 'master' into PR_TOOL_MERGE_PR_20216
jreback File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7580,11 +7580,10 @@ def _add_numeric_operations(cls): | |
cls.any = _make_logical_function( | ||
cls, 'any', name, name2, axis_descr, | ||
'Return whether any element is True over requested axis', | ||
nanops.nanany) | ||
nanops.nanany, '', '') | ||
cls.all = _make_logical_function( | ||
cls, 'all', name, name2, axis_descr, | ||
'Return whether all elements are True over requested axis', | ||
nanops.nanall) | ||
cls, 'all', name, name2, axis_descr, _all_doc, | ||
nanops.nanall, _all_examples, _all_see_also) | ||
|
||
@Substitution(outname='mad', | ||
desc="Return the mean absolute deviation of the values " | ||
|
@@ -7841,25 +7840,77 @@ def _doc_parms(cls): | |
%(outname)s : %(name1)s or %(name2)s (if level specified)\n""" | ||
|
||
_bool_doc = """ | ||
|
||
%(desc)s | ||
|
||
Parameters | ||
---------- | ||
axis : %(axis_descr)s | ||
skipna : boolean, default True | ||
Exclude NA/null values. If an entire row/column is NA, the result | ||
will be NA | ||
will be NA. | ||
level : int or level name, default None | ||
If the axis is a MultiIndex (hierarchical), count along a | ||
particular level, collapsing into a %(name1)s | ||
particular level, collapsing into a %(name1)s. | ||
bool_only : boolean, default None | ||
Include only boolean columns. If None, will attempt to use everything, | ||
then use only boolean data. Not implemented for Series. | ||
**kwargs : any, default None | ||
Additional keywords have no affect but might be accepted for | ||
compatibility with numpy. | ||
|
||
Returns | ||
------- | ||
%(outname)s : %(name1)s or %(name2)s (if level specified)\n""" | ||
%(outname)s : %(name1)s or %(name2)s (if level specified) | ||
|
||
%(examples)s | ||
%(see_also)s""" | ||
|
||
_all_doc = """\ | ||
Return whether all elements are True over series or dataframe axis. | ||
|
||
Returns True if all elements within a series or along a dataframe | ||
axis or are non-zero, not-empty or not-False.""" | ||
|
||
_all_examples = """\ | ||
Examples | ||
-------- | ||
Series | ||
|
||
>>> pd.Series([True, True]).all() | ||
True | ||
>>> pd.Series([True, False]).all() | ||
False | ||
|
||
Dataframes | ||
|
||
Create a dataframe from a dictionary. | ||
|
||
>>> df = pd.DataFrame({'col1': [True, True], 'col2': [True, False]}) | ||
>>> df | ||
col1 col2 | ||
0 True True | ||
1 True False | ||
|
||
Default behaviour checks if column-wise values all return True. | ||
|
||
>>> df.all() | ||
col1 True | ||
col2 False | ||
dtype: bool | ||
|
||
Adding axis=1 argument will check if row-wise values all return True. | ||
|
||
>>> df.all(axis=1) | ||
0 True | ||
1 False | ||
dtype: bool | ||
""" | ||
|
||
_all_see_also = """\ | ||
See also | ||
-------- | ||
pandas.DataFrame.any : Return if one (or more) elements are True | ||
""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add Series.all There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jreback its been added |
||
|
||
_cnum_doc = """ | ||
|
||
|
@@ -8042,9 +8093,10 @@ def cum_func(self, axis=None, skipna=True, *args, **kwargs): | |
return set_function_name(cum_func, name, cls) | ||
|
||
|
||
def _make_logical_function(cls, name, name1, name2, axis_descr, desc, f): | ||
def _make_logical_function(cls, name, name1, name2, axis_descr, desc, f, | ||
examples, see_also): | ||
@Substitution(outname=name, desc=desc, name1=name1, name2=name2, | ||
axis_descr=axis_descr) | ||
axis_descr=axis_descr, examples=examples, see_also=see_also) | ||
@Appender(_bool_doc) | ||
def logical_func(self, axis=None, bool_only=None, skipna=None, level=None, | ||
**kwargs): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove these so they don't conflict with the other PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomAugspurger If I do this an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can keep this. Just depending on which one of the two PRs is merged first, you might need to solve the conflict on the other. But that should be no problem