-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: show series length in repr when truncated (GH15962) #15974
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
BUG: show series length in repr when truncated (GH15962) #15974
Conversation
pandas/formats/format.py
Outdated
@@ -197,7 +197,8 @@ def _get_footer(self): | |||
escape_chars=('\t', '\r', '\n')) | |||
footer += ("Name: %s" % series_name) if name is not None else "" | |||
|
|||
if self.length: | |||
if (self.length is True or |
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.
should have a check on the valid values of this (even though the option actually vets 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.
Yeah, I actually misuse the length
keyword here a bit, which is normally a True/False keyword, but by internally also passing 'truncate' to it (otherwise I had to create a new keyword show_dimensions, which would render length
useless)
pandas/tests/formats/test_format.py
Outdated
@@ -2084,6 +2089,21 @@ def getndots(s): | |||
strrepr = repr(s).replace('\n', '') | |||
self.assertEqual(getndots(strrepr), 3) | |||
|
|||
def test_show_dimensions(self): | |||
s = Series(range(5)) |
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.
add the issue number here
lgtm. |
@jorisvandenbossche can you update |
Also follow the display.show_dimensions option.
9a7c017
to
9bcfd76
Compare
9bcfd76
to
daf01f7
Compare
Codecov Report
@@ Coverage Diff @@
## master #15974 +/- ##
==========================================
+ Coverage 90.99% 91% +<.01%
==========================================
Files 153 153
Lines 50481 50478 -3
==========================================
- Hits 45937 45935 -2
+ Misses 4544 4543 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #15974 +/- ##
==========================================
+ Coverage 90.99% 91% +<.01%
==========================================
Files 153 153
Lines 50481 50478 -3
==========================================
- Hits 45937 45935 -2
+ Misses 4544 4543 -1
Continue to review full report at Codecov.
|
Also follow the display.show_dimensions option.
git diff upstream/master --name-only -- '*.py' | flake8 --diff