Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
david-cortes opened this issue Dec 9, 2019 · 1 comment · Fixed by #30209
Closed

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

david-cortes opened this issue Dec 9, 2019 · 1 comment · Fixed by #30209
Labels
Datetime Datetime data dtype Enhancement Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@david-cortes
Copy link
Contributor

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"
@mroeschke
Copy link
Member

Sure that sounds reasonable. PR's welcome!

@mroeschke mroeschke added Enhancement Numeric Operations Arithmetic, Comparison, and Logical operations Datetime Datetime data dtype labels Dec 11, 2019
david-cortes pushed a commit to david-cortes/pandas that referenced this issue Dec 11, 2019
david-cortes added a commit to david-cortes/pandas that referenced this issue Dec 11, 2019
david-cortes added a commit to david-cortes/pandas that referenced this issue Dec 11, 2019
david-cortes added a commit to david-cortes/pandas that referenced this issue Dec 12, 2019
david-cortes added a commit to david-cortes/pandas that referenced this issue Dec 12, 2019
david-cortes added a commit to david-cortes/pandas that referenced this issue Dec 12, 2019
david-cortes added a commit to david-cortes/pandas that referenced this issue Jan 18, 2020
@jreback jreback added this to the 1.1 milestone Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Enhancement Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants