Skip to content

Request: show datetime percentiles in 'describe' method #30164

Closed
@david-cortes

Description

@david-cortes

Would be nice if pandas.Series.describe would show percentiles of datetime dtypes in the same way it does for other numeric types:

import pandas as pd
dt_list = [
    "2019-01-01 00:01:00",
    "2019-01-01 00:02:00",
    "2019-01-01 00:02:10",
    "2019-01-01 00:10:01",
    "2019-01-01 00:11:00"
]
s = pd.to_datetime(pd.Series(dt_list))
s.describe()
count                       5
unique                      5
top       2019-01-01 00:02:00
freq                        1
first     2019-01-01 00:01:00
last      2019-01-01 00:11:00
dtype: object
s.describe(percentiles = [0.25, 0.5, 0.75])
### doesn't show percentiles

Compare to R:

dt <- c(
	"2019-01-01 00:01:00",
	"2019-01-01 00:02:00",
	"2019-01-01 00:02:10",
	"2019-01-01 00:10:01",
	"2019-01-01 00:11:00"
)
summary(as.POSIXct(dt))
                 Min.               1st Qu.                Median                  Mean               3rd Qu.                  Max. 
"2019-01-01 00:01:00" "2019-01-01 00:02:00" "2019-01-01 00:02:10" "2019-01-01 00:05:14" "2019-01-01 00:10:01" "2019-01-01 00:11:00"

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