-
-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Open
Labels
API - ConsistencyInternal Consistency of API/BehaviorInternal Consistency of API/BehaviorEnhancementIO CSVread_csv, to_csvread_csv, to_csvOutput-Formatting__repr__ of pandas objects, to_string__repr__ of pandas objects, to_string
Description
For now just some observations:
- The docstring of different funtions about
float_format
:- the documentation of
to_csv
(as well asto_excel
) states:string, Format string for floating point numbers
- Example of this usage:
df.to_csv(float_format='%.3f')
- Example of this usage:
- The docstring of
to_string
(as well asto_html
) says:one-parameter function, Formatter function to apply to columns’ elements if they are floats
- Example of this usage:
df.to_string(float_format='{:.3f}'.format)
- Example of this usage:
- The option
display.float_format
also accepts a callable following the docs
- the documentation of
- The narrative docs are consistent with that:
Question:
- Should we make this consistent? Eg that all methods can accept both a format string as a format function?
- Should we make the usage of
'{:.3f}'.format)
more convenient?
There are a lot of different issues already about formatting, but I didn't find anything about this in specific.
Metadata
Metadata
Assignees
Labels
API - ConsistencyInternal Consistency of API/BehaviorInternal Consistency of API/BehaviorEnhancementIO CSVread_csv, to_csvread_csv, to_csvOutput-Formatting__repr__ of pandas objects, to_string__repr__ of pandas objects, to_string