-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API: consistent float_format specification #9448
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
Labels
API - Consistency
Internal Consistency of API/Behavior
Enhancement
IO CSV
read_csv, to_csv
Output-Formatting
__repr__ of pandas objects, to_string
Comments
put he reference on #4668 |
This is probably a separate issue, but:
Just to be sure: there is still no way to provide a per column If so, and if we're going to shoot for consistent See also: |
This was referenced Jun 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
API - Consistency
Internal Consistency of API/Behavior
Enhancement
IO CSV
read_csv, to_csv
Output-Formatting
__repr__ of pandas objects, to_string
For now just some observations:
float_format
:to_csv
(as well asto_excel
) states:string, Format string for floating point numbers
df.to_csv(float_format='%.3f')
to_string
(as well asto_html
) says:one-parameter function, Formatter function to apply to columns’ elements if they are floats
df.to_string(float_format='{:.3f}'.format)
display.float_format
also accepts a callable following the docsQuestion:
'{:.3f}'.format)
more convenient?There are a lot of different issues already about formatting, but I didn't find anything about this in specific.
The text was updated successfully, but these errors were encountered: