Skip to content

Describe() does not work properly on timedelta64 #6145

Closed
@vfilimonov

Description

@vfilimonov

When being described, series of timedelta64 resulted in misformatted output:

Test example:

xx = pd.DataFrame({'t1':pd.date_range('2010-01-01 00:00:00', freq='T', periods=10),
                   't2':pd.date_range('2010-01-01 00:00:00', freq='2T', periods=10)})
xx['dt'] = xx['t2']-xx['t1']
print xx

Then xx.dt.describe() returns:

>>> xx.dt.describe()
count                                     10
mean     0   00:04:30
dtype: timedelta64[ns]
std                              1.81659e+11
min      0   00:00:00
dtype: timedelta64[ns]
25%                 135000000000 nanoseconds
50%      0   00:04:30
dtype: timedelta64[ns]
75%                 405000000000 nanoseconds
max      0   00:09:00
dtype: timedelta64[ns]
Name: dt, dtype: object

Describe of datetime64 works fine:

>>> xx.t1.describe()
count                      10
unique                     10
first     2010-01-01 00:00:00
last      2010-01-01 00:09:00
top       2010-01-01 00:00:00
freq                        1
Name: t1, dtype: object

Issue was found both in version 0.13.0 and master (0.13.0-417-g1ed5c3e).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions