FMT: allow datetime/timedelta formatting on a column to be better · Issue #3401 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@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