-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Conversation
if self._info_repr(): | ||
self.info(buf=buf) | ||
info_verbose = get_option("display.info_verbose") | ||
if self._info_repr() and info_verbose: |
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.
here and the next section: just pass verbose=info_verbose rather than having an if/then
@jreback I know you were in favor of making it a seperate option instead of adding
|
this sets the default for df.info(...) I agree it's only when the info repr is triggered in the first place @bjonen if we change this option to really be a subset of large_repr iow have 3 options: False, True/verbose (verbose=False), concise (verbose=False) that would work yes? though I think the default should be concise (so maybe have to fiddle with this a bit to be backward compat) |
Thanks for your comments. I think it's a good idea to directly control |
3 options for |
@jreback @jorisvandenbossche |
So the options would be:
Personally I don't really have a preference (I won't use any of both options) |
hmm I think I like the separate option with a default of False (which is an API change) |
Why a default of False? Is there a reason to change the behaviour of |
How do you think we should change the default on df.info?
Any thoughts?
|
I am pretty sure the default was False in 0.12 @bjonen can u see if that was the case? @jorisvandenbossche this doesn't need to be complicated |
Yes it did change in 0.13 but it seems it was intentional: #4886 "df.info() works as is and u can pass a parameter If I understand correctly, this is the version currently implemented in the PR. That means the option value (True/False) will only have an impact when a |
ok the default wasn't meant to change change the signature to df.info(verbose=None) then handle a passed true/false as an override |
Ok sounds good! |
Ok so
I'll adapt the PR. |
@jreback don't you have the
But maybe we are just misinterpreting each other words, as I think the default for |
hmm don't know @bjonen can u investigate this? |
@@ -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. | |||
|
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:')
.. 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 comment
The reason will be displayed to describe this comment to others. Learn more.
use print(df_lrge)
(for py3 compat in doc building) instead of print
minor edit can you post at the top of the issue what the 3 cases are (e.g. what the docs are going to show) |
@jorisvandenbossche
In [12]: import pandas as pd In [13]: df = pd.DataFrame(columns=['a','b','c'],index=pd.DatetimeIndex(start='19900101',end='20000101',freq='BM')) In [15]: pd.options.display.large_repr = 'info' In [16]: df In [17]: pd.options.display.max_columns = 1 In [18]: df In [19]: pd.options.display.max_info_columns = 1 In [20]: df In [21]: df.info(False) @jreback Looking at previous commits in git:
it seems that the default has been |
@bjonen ok on the default then (I think I personally set it to False, but that is fine then) you need to use a frame with > |
I reset the default below the number of columns (3) in the df (see previous post): pd.options.display.max_info_columns = 1 |
@bjonen hmm.. see if you can figure out from the tests what it is supposed to do. All of the options have complex interactions. If its a 'bug' would rather fix than add a new option if we can (e.g. you are suggesting that if you have columns > |
Yes, exactly. I'll look into it and let you guys know. |
@bjonen That The strange behaviour of
which is much more logical and in line with the explanation ( But that seems like a seperate issue. |
It seems the behavior was introduced in 0.13.1 In [22]: pd.version In [27]: pd.options.display.max_info_columns = 100 In [28]: df.info() In [30]: df.info() The explanation for So the |
ahh...I do recal this a bit, @y-p put this in IIRC to not do the non-null check if you have a very large frame that would be displayed in a summary anyhow but maybe it introduced a bug (as @jorisvandenbossche describes) can you simply this (w/o creating more havoc!) |
I just opened a seperate issue (#6939), as I thought this was seperate from this discussion? So can you maybe repeat that overthere? |
Ok will do. |
@bjonen any luck with this ? |
@jreback I'm currently working on #5603 (comment) . |
@bjonen coming along? |
I'll submit a PR tonight so you see where I am at. |
I pushed the current state to https://github.com/bjonen/pandas/commits/adj_trunc. The truncate represantation is generally working. Feel free to check out the displaying of large dfs. Still there are some tests (mainly in test_frame) not passing. Looking into it... |
closing in favor or #7130 |
This adds a info_verbose to the options. There's a small section in faq and basic introduction. Entry in v0.14 is still missing.
Closes #6568