-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
I can set display.float_format to "{:.1f}".format to get a very short output, but timedelta64[ns] is still printed as 0 days 00:05:09.812000 instead of 5m (as it would if I could set display.timedelta_format to my own function).
Feature Description
Add display.timedelta_format, display.timestamp_format &c that can be set to a callable that takes an object of the specified type and returns a string.
Alternative Solutions
Alternatively, replace display.float_format with a generic display.format which would receive an object (int or float or Timestamp or Timedelta or whatever) and return either a string or NotImplemented to indicate that the default (built-in) method is to be used.
Alternatively, display.format can be a dict wher display.format[float] has the same meaning as display.float_format now.
Additional Context
No response