-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
DatetimeDatetime data dtypeDatetime data dtypeEnhancementNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations
Milestone
Description
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"
Liam3851
Metadata
Metadata
Assignees
Labels
DatetimeDatetime data dtypeDatetime data dtypeEnhancementNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations