Skip to content

FMT: allow datetime/timedelta formatting on a column to be better #3401

Closed
@jreback

Description

@jreback

http://stackoverflow.com/questions/16103238/pandas-timedelta-in-days/16104567#16104567

Its easy to think about, e.g. if no dates in a particular column have time values, then can print them w/o the time values (e.g. just 2001-01-01 maybe), I think this would be nice as the default (maybe add an option for it?)

In [17]: df
Out[17]: 
                  age               today                diff      years
0 2001-01-01 00:00:00 2013-04-19 00:00:00 4491 days, 00:00:00  12.304110
1 2004-06-01 00:00:00 2013-04-19 00:00:00 3244 days, 00:00:00   8.887671

Better?

In [17]: df
Out[17]: 
         age      today      diff     years
0 2001-01-01 2013-04-19 4491 days 12.304110
1 2004-06-01 2013-04-19 3244 days  8.887671

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementIdeasLong-Term Enhancement DiscussionsOutput-Formatting__repr__ of pandas objects, to_stringTimedeltaTimedelta data type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions