-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN FloatArrayFormatter #12194
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
CLN FloatArrayFormatter #12194
Conversation
Ok, that should do. What I have done:
This seems (to me) the simplest way to know which method should be used. I have merged the two independent pieces of code that we used to have, and which were doing basically the same thing. But |
# separate the wheat from the chaff | ||
values = self.values | ||
mask = isnull(values) | ||
if hasattr(values, 'to_dense'): # sparse array |
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.
you can always call this, to_dense()
is a generic method (doesn't do anything to non-dense things)
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.
AttributeError: 'numpy.ndarray' object has no attribute 'to_dense'
:)
All green |
this looked ok last time. pls rebase and repush. |
@jreback all set |
does this actually change any features? e.g. implement the decimal fix? (or is that another PR), this just cleanup? |
thanks! |
No, that was just a cleanup, that's why I haven't touched the tests. Now I should be able to move on to the decimal parameter (issue #12031) |
Float values were being quoted despite the quoting spec. Bug traced to the float formatting that was unconditionally casting all floats to string. Unconditional casting traced back to commit 2d51b33 (pandas-devgh-12194) via bisection. This commit undoes some of those changes to rectify the behaviour. Closes pandas-devgh-12922. [ci skip]
Closes #12922: "bug" traced to #12194 Author: gfyoung <[email protected]> Closes #13418 from gfyoung/to-csv-quote-bugfix and squashes the following commits: 8e53112 [gfyoung] BUG: Fix quoting behaviour in to_csv for csv.QUOTE_NONNUMERIC
I'm working on #12164
This is a work in progress.