-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REF: prepare dataframe info for series info #37868
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ad0c3ed
REF: dataframe info
ivanovmg ad35946
DOC: add newlines after triple quotes
ivanovmg b0f9ca1
DOC: update type in docstring
ivanovmg 9accc28
FIX: add missing abstractmethod
ivanovmg 48abf79
Merge branch 'master' into refactor/dataframe-info
ivanovmg effe7fb
Merge branch 'master' into refactor/dataframe-info
ivanovmg cc83706
Merge branch 'master' into refactor/dataframe-info
ivanovmg 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 |
---|---|---|
|
@@ -159,7 +159,7 @@ | |
|
||
from pandas.io.common import get_handle | ||
from pandas.io.formats import console, format as fmt | ||
from pandas.io.formats.info import DataFrameInfo | ||
from pandas.io.formats.info import BaseInfo, DataFrameInfo | ||
import pandas.plotting | ||
|
||
if TYPE_CHECKING: | ||
|
@@ -2523,16 +2523,25 @@ def to_html( | |
@Substitution( | ||
klass="DataFrame", | ||
type_sub=" and columns", | ||
max_cols_sub=( | ||
"""max_cols : int, optional | ||
max_cols_sub=dedent( | ||
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. can you do a followup where you switch to using |
||
"""\ | ||
max_cols : int, optional | ||
When to switch from the verbose to the truncated output. If the | ||
DataFrame has more than `max_cols` columns, the truncated output | ||
is used. By default, the setting in | ||
``pandas.options.display.max_info_columns`` is used. | ||
""" | ||
``pandas.options.display.max_info_columns`` is used.""" | ||
), | ||
examples_sub=( | ||
""" | ||
null_counts_sub=dedent( | ||
"""\ | ||
null_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.""" | ||
), | ||
examples_sub=dedent( | ||
"""\ | ||
>>> int_values = [1, 2, 3, 4, 5] | ||
>>> text_values = ['alpha', 'beta', 'gamma', 'delta', 'epsilon'] | ||
>>> float_values = [0.0, 0.25, 0.5, 0.75, 1.0] | ||
|
@@ -2615,14 +2624,15 @@ def to_html( | |
dtypes: object(3) | ||
memory usage: 165.9 MB""" | ||
), | ||
see_also_sub=( | ||
""" | ||
see_also_sub=dedent( | ||
"""\ | ||
DataFrame.describe: Generate descriptive statistics of DataFrame | ||
columns. | ||
DataFrame.memory_usage: Memory usage of DataFrame columns.""" | ||
), | ||
version_added_sub="", | ||
) | ||
@doc(DataFrameInfo.to_buffer) | ||
@doc(BaseInfo.render) | ||
def info( | ||
self, | ||
verbose: Optional[bool] = None, | ||
|
@@ -2635,7 +2645,7 @@ def info( | |
data=self, | ||
memory_usage=memory_usage, | ||
) | ||
info.to_buffer( | ||
info.render( | ||
buf=buf, | ||
max_cols=max_cols, | ||
verbose=verbose, | ||
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.