-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
ENH (GH6568) Add option info_verbose #6890
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 |
---|---|---|
|
@@ -1666,3 +1666,35 @@ columns of DataFrame objects are shown by default. If ``max_columns`` is set to | |
0 (the default, in fact), the library will attempt to fit the DataFrame's | ||
string representation into the current terminal width, and defaulting to the | ||
summary view otherwise. | ||
|
||
The visualization of a dataframe can be controled directly with two | ||
options - `large_repr` and `info_verbose`. Depending on the size of | ||
the DataFrame it might be more convenient to print a summary | ||
representation only. | ||
|
||
.. ipython:: python | ||
|
||
df_lrge = DataFrame(columns=['a','b','c'], | ||
index=DatetimeIndex(start='19900101',end='20000101',freq='BM')) | ||
|
||
The default display for a DataFrame is 'truncate'. This prints all | ||
elements of the df up to max_rows/max_columns. | ||
|
||
.. ipython:: python | ||
|
||
with option_context("display.large_repr",'truncate'): | ||
print df_lrge | ||
|
||
To get a more concise representation of the df | ||
|
||
.. ipython:: python | ||
|
||
with option_context("display.large_repr",'info'): | ||
print df_lrge | ||
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. use |
||
|
||
Further reduce summary view to one line for all columns | ||
|
||
.. ipython:: python | ||
|
||
with option_context("display.large_repr",'info',"display.info_verbose",False): | ||
print df_lrge |
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 |
---|---|---|
|
@@ -183,8 +183,17 @@ | |
df.info() (the behaviour in earlier versions of pandas). | ||
""" | ||
|
||
pc_info_verbose_doc = """ | ||
: boolean | ||
|
||
Relevant when `large_repr` set to `info`. Dictates whether a df | ||
will be displayed as df.info(verbose=True) or | ||
df.info(verbose=False). When `False`, columns are displayed in a | ||
summary line, instead of listing all columns. | ||
""" | ||
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 add the default value? |
||
|
||
pc_mpl_style_doc = """ | ||
: bool | ||
: boolean | ||
|
||
Setting this to 'default' will modify the rcParams used by matplotlib | ||
to give plots a more pleasing visual style by default. | ||
|
@@ -230,6 +239,8 @@ def mpl_style_cb(key): | |
validator=is_instance_factory([type(None), int])) | ||
cf.register_option('large_repr', 'truncate', pc_large_repr_doc, | ||
validator=is_one_of_factory(['truncate', 'info'])) | ||
cf.register_option('info_verbose', True, pc_info_verbose_doc, | ||
validator=is_bool) | ||
cf.register_option('max_info_columns', 100, pc_max_info_cols_doc, | ||
validator=is_int) | ||
cf.register_option('colheader_justify', 'right', colheader_justify_doc, | ||
|
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 add this same thing (you can copy-paste) to v0.14.0 as its a bit of a change, want to inform users, create a new sub-section (e.g. use
----
under the heading), put after the plotting sub-section (include a pointer to the basics section a ':ref:')