-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Rounding to significant figures #11968
Comments
Perhaps this could be a boolean keyword-only argument for
If set to |
I was thinking that but then thought it might be distinct enough (given the use with integers to) to have in a separate function. Happy to go with what you would prefer though! In the PR I called it round_sf - though maybe that is not clear enough so happy to refactor to round_significant. |
@orlp should I make the name more expressive or anything? |
I had a discussion with @stinodego and I believe we settled on adding this functionality, but as a separate function named |
Thank you very much for this it will be a great help. Can you let me know if my PR is looking good? I have refactored to this function as requested. |
Description
Recently I have been working on a project where we needed to round to significant figures and realised there is no way to do this in pandas, numpy or polars. I found this as the best solution.
However it would be nice to have it as part of a package. Would it be possible to include this?
I have implemented this already here #11959 which is about 20% faster than the numpy one here already. However I can imagine there is a better way than using the zip_with maybe?
Thank you!
The text was updated successfully, but these errors were encountered: