-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: fix stray comma in _array2string #9815
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
6825c4d
to
c4cb384
Compare
numpy/core/arrayprint.py
Outdated
@@ -373,7 +373,7 @@ def wrapper(self, *args, **kwargs): | |||
@_recursive_guard() | |||
def _array2string(a, options, separator=' ', prefix=""): | |||
if a.size > options['threshold']: | |||
summary_insert = "..., " | |||
summary_insert = "..." + separator |
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 push this inside _formatArray
? It receives both arguments, so can concatenate them itself
Tests and fix looks good, just a minor refactor suggested |
_array2string unconditionally added a comma after the '...' that are inserted for arrays exceeding the size threshold. Instead, add the separator character in _formatArray. Fixes numpy#9777.
c4cb384
to
80c624e
Compare
@eric-wieser: moved the concatenation of summary_insert and the separator to _formatArray |
Thanks for your first contibution, @nafest. Adding a "needs release note" tag, in case we want to add a remark about this alongside all the other str/repr changes that are going into this release when we do a final pass over the release notes. |
_array2string unconditionally added a comma after the '...' that
are inserted for arrays exceeding the size threshold. Add the
separator character instead. Fixes #9777.