-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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: Deprecate null_counts parameter of DataFrame.info #37999
Merged
jreback
merged 6 commits into
pandas-dev:master
from
hongshaoyang:36805-deprecate-nullcounts
Nov 25, 2020
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ef5d8f6
DOC: Deprecate null_counts
hongshaoyang f1aafa0
Add test and whatsnew
hongshaoyang 5a253a5
Merge branch 'master' into 36805-deprecate-nullcounts
hongshaoyang d647cd7
Fix merge
hongshaoyang 09f8438
Add tests for bad combination of null_counts + show_counts
hongshaoyang aa0c57f
Clarify whatsnew
hongshaoyang 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
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 |
---|---|---|
|
@@ -2531,14 +2531,17 @@ def to_html( | |
is used. By default, the setting in | ||
``pandas.options.display.max_info_columns`` is used.""" | ||
), | ||
null_counts_sub=dedent( | ||
show_counts_sub=dedent( | ||
"""\ | ||
null_counts : bool, optional | ||
show_counts : bool, optional | ||
Whether to show the non-null counts. By default, this is shown | ||
only if the DataFrame is smaller than | ||
``pandas.options.display.max_info_rows`` and | ||
``pandas.options.display.max_info_columns``. A value of True always | ||
shows the counts, and False never shows the counts.""" | ||
shows the counts, and False never shows the counts. | ||
null_counts : bool, optional | ||
.. deprecated:: 1.2.0 | ||
Use show_counts instead.""" | ||
), | ||
examples_sub=dedent( | ||
"""\ | ||
|
@@ -2639,8 +2642,18 @@ def info( | |
buf: Optional[IO[str]] = None, | ||
max_cols: Optional[int] = None, | ||
memory_usage: Optional[Union[bool, str]] = None, | ||
show_counts: Optional[bool] = None, | ||
null_counts: Optional[bool] = None, | ||
) -> None: | ||
if null_counts is not None: | ||
if show_counts is not None: | ||
raise ValueError("null_counts used with show_counts") | ||
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. I suggest adding |
||
warnings.warn( | ||
"null_counts is deprecated. Use show_counts instead", | ||
FutureWarning, | ||
stacklevel=2, | ||
) | ||
show_counts = null_counts | ||
info = DataFrameInfo( | ||
data=self, | ||
memory_usage=memory_usage, | ||
|
@@ -2649,7 +2662,7 @@ def info( | |
buf=buf, | ||
max_cols=max_cols, | ||
verbose=verbose, | ||
show_counts=null_counts, | ||
show_counts=show_counts, | ||
) | ||
|
||
def memory_usage(self, index=True, deep=False) -> Series: | ||
|
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
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
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
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.
Can you indicate here that the keyword is renamed to
show_counts
?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.
Added
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.
There's an unrelated test on Travis that fails intermittently