-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Improve the docstring of DataFrame.describe() #20222
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
Merged
jreback
merged 9 commits into
pandas-dev:master
from
nehiljain:docstrings_dataframe_describe
Jul 8, 2018
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
916624c
DOC: Improve the docstring of DataFrame.describe()
nehiljain d365098
fixed order of columns
nehiljain 777dadf
Merge remote-tracking branch 'upstream/master' into docstrings_datafr…
nehiljain aa13b25
more comments incorporated
nehiljain 8da3c9a
return documentation changed and see also moved so section 5 as per d…
nehiljain 1277860
missed a pep-8 related comment
nehiljain 66dab96
Merge remote-tracking branch 'upstream/master' into docstrings_datafr…
nehiljain 0f4e8ed
Merge remote-tracking branch 'upstream/master' into docstrings_datafr…
c570d24
Merge remote-tracking branch 'upstream/master' into docstrings_datafr…
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 hidden or 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 |
---|---|---|
|
@@ -7179,7 +7179,7 @@ def abs(self): | |
|
||
def describe(self, percentiles=None, include=None, exclude=None): | ||
""" | ||
Generates descriptive statistics that summarize the central tendency, | ||
Generate descriptive statistics that summarize the central tendency, | ||
dispersion and shape of a dataset's distribution, excluding | ||
``NaN`` values. | ||
|
||
|
@@ -7267,6 +7267,7 @@ def describe(self, percentiles=None, include=None, exclude=None): | |
50% 2.0 | ||
75% 2.5 | ||
max 3.0 | ||
dtype: float64 | ||
|
||
Describing a categorical ``Series``. | ||
|
||
|
@@ -7315,18 +7316,18 @@ def describe(self, percentiles=None, include=None, exclude=None): | |
Describing all columns of a ``DataFrame`` regardless of data type. | ||
|
||
>>> df.describe(include='all') | ||
categorical numeric object | ||
count 3 3.0 3 | ||
unique 3 NaN 3 | ||
top f NaN c | ||
freq 1 NaN 1 | ||
mean NaN 2.0 NaN | ||
std NaN 1.0 NaN | ||
min NaN 1.0 NaN | ||
25% NaN 1.5 NaN | ||
50% NaN 2.0 NaN | ||
75% NaN 2.5 NaN | ||
max NaN 3.0 NaN | ||
object numeric categorical | ||
count 3 3.0 3 | ||
unique 3 NaN 3 | ||
top c NaN f | ||
freq 1 NaN 1 | ||
mean NaN 2.0 NaN | ||
std NaN 1.0 NaN | ||
min NaN 1.0 NaN | ||
25% NaN 1.5 NaN | ||
50% NaN 2.0 NaN | ||
75% NaN 2.5 NaN | ||
max NaN 3.0 NaN | ||
|
||
Describing a column from a ``DataFrame`` by accessing it as | ||
an attribute. | ||
|
@@ -7376,36 +7377,36 @@ def describe(self, percentiles=None, include=None, exclude=None): | |
Excluding numeric columns from a ``DataFrame`` description. | ||
|
||
>>> df.describe(exclude=[np.number]) | ||
categorical object | ||
count 3 3 | ||
unique 3 3 | ||
top f c | ||
freq 1 1 | ||
object categorical | ||
count 3 3 | ||
unique 3 3 | ||
top c f | ||
freq 1 1 | ||
|
||
Excluding object columns from a ``DataFrame`` description. | ||
|
||
>>> df.describe(exclude=[np.object]) | ||
categorical numeric | ||
count 3 3.0 | ||
unique 3 NaN | ||
top f NaN | ||
freq 1 NaN | ||
mean NaN 2.0 | ||
std NaN 1.0 | ||
min NaN 1.0 | ||
25% NaN 1.5 | ||
50% NaN 2.0 | ||
75% NaN 2.5 | ||
max NaN 3.0 | ||
numeric categorical | ||
count 3.0 3 | ||
unique NaN 3 | ||
top NaN f | ||
freq NaN 1 | ||
mean 2.0 NaN | ||
std 1.0 NaN | ||
min 1.0 NaN | ||
25% 1.5 NaN | ||
50% 2.0 NaN | ||
75% 2.5 NaN | ||
max 3.0 NaN | ||
|
||
See Also | ||
-------- | ||
DataFrame.count | ||
DataFrame.max | ||
DataFrame.min | ||
DataFrame.mean | ||
DataFrame.std | ||
DataFrame.select_dtypes | ||
DataFrame.count : Count number of non-NA/null observations | ||
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. See Also goes before Examples 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. fixed thanks |
||
DataFrame.max : Maximum of the values in the object | ||
DataFrame.min : Minimum of the values in the object | ||
DataFrame.mean : Mean of the values | ||
DataFrame.std : Standard deviation of the obersvations | ||
DataFrame.select_dtypes : Subset of a DataFrame including/excluding columns based on their dtype | ||
""" | ||
if self.ndim >= 3: | ||
msg = "describe is not implemented on Panel objects." | ||
|
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.
is there a reason these are being changed? they are already in alphabetical order. I suppose you could supply columns on construction to guarantee the order.
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.
thanks for the suggestion. Updated it with your recommendation.