-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: Extra space is inserted on first line for long elements #10182
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
* For line-wrapping: | ||
|
||
* The "dtype" part of ndarray reprs will now be printed on the next line | ||
if there isn't space on the last line of array output. | ||
* The ``linewidth`` format option is now always respected. | ||
The `repr` or `str` of an array will never exceed this, unless a single | ||
element is too wide. | ||
* All but the last line of array strings will contain the same number of | ||
elements. |
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 is only a change in extremely contrived scenarios (custom separators), so probably doesn't belong here.
LGTM. |
numpy/core/arrayprint.py
Outdated
if len(line) + len(word) > line_width: | ||
def _extendLine(s, line, word, line_width, next_line_prefix, legacy): | ||
needs_wrap = len(line) + len(word) > line_width | ||
if legacy != '1.13' and len(line) == len(next_line_prefix): |
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 suppose strictly this should be <=
, but in practice that never happens
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.
Sure you don't want to change it before this goes in?
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.
Guess I will. Updated
e4aa8e3
to
c9052f0
Compare
Thanks Eric. |
Fixes gh-10181
Also strip some trailing spaces added by the web editor in the release notes.