-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: show numbers on .info() with verbose flag #28876
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
Conversation
This is a duplicate of #28696 which was a continuation of #17332 - did you address comments from those? @Alexandreae were you still working on that? |
Apologies, I completely missed this entire discussion. I was not aware someone else was working on it. I did see the comment left in #17304, but I started working on it as that was months ago. Let me have a look at the comments, then I'll finish up. Still, you can close this if @Alexandreae responds. |
All the suggestions from #17332 have been implemented. Please let me know what you think |
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.
Cool thanks for picking this up. cc @bashtage who had some thoughts on original design
Output looks pretty good and better than current. Does it work well with very long variable names? Or other long info properties? Wondering since the ----- bits are new. |
Sample for long column name variables. col_count = 10
max_col_name = 80
df = pd.DataFrame(np.random.rand(4, col_count), columns=[
'%s' % (np.random.randint(2, max_col_name)*'a') for x in range(col_count)])
df.info(verbose=True) Output:
Regarding dtypes, there's a test, and for non-null count there is a docstring test. For the numbering I added an assertion in the verbosity test, as I did not feel like posting a thousand line output here. |
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.
this needs some eye balls in it from @pandas-dev/pandas-core
Look readable in this extreme case. |
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.
I think this is nice and improves readability
@pandas-dev/pandas-core anyone else care to take a look? |
ping @pandas-dev/pandas-core for any other comments |
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.
Overall an improvement from the prior output. One small comment.
@jreback care to take a look or merge? |
yep will again |
doc/source/whatsnew/v1.0.0.rst
Outdated
@@ -50,6 +50,8 @@ including other versions of pandas. | |||
Enhancements | |||
~~~~~~~~~~~~ | |||
|
|||
- :meth:`Dataframe.info` now shows line numbers for the columns summary (:issue:`17304`) |
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 make a small sub-section showing these changes. move to the api breaking section as this is a change in the output repr.
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.
I added the difference to the Backwards incompatible API changes section. Hope that is what you meant
@Roymprog looks like some merge conflicts - can you clean up and re-push? |
@Roymprog can you fix up merge conflict? |
I will in the coming week |
@jreback any outstanding thoughts on this? |
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.
lgtm. small doc-presentation change. ping on green.
@@ -292,6 +292,34 @@ New repr for :class:`~pandas.arrays.IntervalArray` | |||
|
|||
pd.arrays.IntervalArray.from_tuples([(0, 1), (2, 3)]) | |||
|
|||
- :meth:`Dataframe.info` now shows line numbers for the columns summary (:issue:`17304`) |
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 a title and underline here (like other sub-sections).
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 an underlined title for the new feature, thanks for the feedback
@Roymprog CI failure:
|
thanks @Roymprog very . nice! |
Thanks for the fix @TomAugspurger. Thank you all for all the feedback I received. This was my first open source pull request, thanks for making it happen 😃 |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff