You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
array2string() (numpy/core/arrayprint.py) is the method that generates the string here. It has different cases based on the number of dimensions. If ndims == 0 it handles the case manually, and if ndims > 0 it calls _array2string().
All of the logic of handling different ways of formatting/precision is in _array2string(). The ndims == 0 implementation ignores the precision setting completely.
This is a little bigger than an easy fix. It seems to me that either _array2string() should to be made capable of handling 0d arrays or the formatting logic should be moved out of _array2string().
Activity
numpy-gitbot commentedon Oct 19, 2012
Milestone changed to
Unscheduledby @mwiebe on 2011-03-23charris commentedon Feb 20, 2014
Still broken 1.9-devel.
ddasilva commentedon Mar 15, 2014
array2string()(numpy/core/arrayprint.py) is the method that generates the string here. It has different cases based on the number of dimensions. If ndims == 0 it handles the case manually, and if ndims > 0 it calls_array2string().All of the logic of handling different ways of formatting/precision is in
_array2string(). The ndims == 0 implementation ignores the precision setting completely.ddasilva commentedon Mar 15, 2014
This is a little bigger than an easy fix. It seems to me that either
_array2string()should to be made capable of handling 0d arrays or the formatting logic should be moved out of_array2string().eric-wieser commentedon Sep 25, 2017
@ahaldane: Can this be closed already, or are we still waiting on a PR for this one?
ahaldane commentedon Sep 25, 2017
While this is currently fixed in master we are still changing this behavior in #9332 . How about I add it to the "fixed" commit message there?
ENH: fix 0d array printing using `str` or `formatter`.
ENH: fix 0d array printing using `str` or `formatter`.