-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Inconsistency in return value of mean, median, and quantile on timedelta64[ns] series #4984
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
Comments
by definition
in 0.13/master this is supported
|
let me see if can do the automatic inferring....prob not too hard |
Yeah, it makes sense that mean and median return float (because they have to). I guess what I would do (if I were designing the API) would be to have quantile also return float even though it does not strictly need to - for the sake of consistency. Thanks for the tip about the new stuff in 0.13 |
@nathanwdavis I just fixed this in #4985; they can easily return timedeltas (and it makes sense), it just truncates the float (at the ns level), so no biggie. Note that most
|
@jreback Very nice!! I like this. You're fast too 👍 Looking forward to 0.13... |
hahah...95% was already done....this was just a last little bit... |
If I have a Series of
timedelta64[ns]
(the result of adiff()
on a Timestamp Series in my case), doing mean, median, and quantile operations on that series returns inconsistent values. Example:As you can see,
mean
andmedian
return a float (although the printed Out is a little different), butquantile
returns a singletimedelta64[ns]
.This is with versions pandas==0.12.0 and numpy==1.7.1
The text was updated successfully, but these errors were encountered: