-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
np.set_printoptions doesn't affect floats #11048
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
Comments
A simpler reproduction is:
@ahaldane, do you think this is a feature (full precision is always shown for scalars) or an omission? |
We definitely discussed this before, and I recall that it is intentional. Perhaps here?: #9201 (comment) (there may have been other places) Anyway, I think for back-compat reasons we concluded that scalars must continue using a hardcoded repr, ie they are not affected by |
I also looked back at that issue, and I think what I meant to say was that |
This is very confusing. I just ran into the issue again that the following two prints give different results:
Could we revisit this decision? |
I think this is because float inherits from Python float and uses that for printing. |
@charris: I get the same behavior for |
I think the decision goes something like this:
I'm not sure I can rationalize the first step. |
For the record, this behavior goes back as far as numpy 1.0.1, and probably before. #9201 shows our attempts to update the str/repr of 0d arrays and why we had to keep this behavior. As I recall it was due to people expecting that |
The text was updated successfully, but these errors were encountered: