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

np.sum(TimedeltaIndex) should return a Timedelta, not np.timedelta64 #25335

Closed
jbrockmendel opened this issue Feb 15, 2019 · 4 comments · Fixed by #28165
Closed

np.sum(TimedeltaIndex) should return a Timedelta, not np.timedelta64 #25335

jbrockmendel opened this issue Feb 15, 2019 · 4 comments · Fixed by #28165
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Bug Datetime Datetime data dtype Timedelta Timedelta data type
Milestone

Comments

@jbrockmendel
Copy link
Member

ditto TimedeltaArray. xref #25329.

I think the relevant method is __array_ufunc__, @jorisvandenbossche any idea about this?

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Feb 15, 2019

I think the relevant method is __array_ufunc__, @jorisvandenbossche any idea about this?

The datetimelike indexes and arrays don't implement __array_ufunc__ yet, do they? Or are you saying that the fix is to implement it?

The old (pre-numpy 1.13) way of doing this would be with __array_ufunc__, which is defined on our indexes.

@jorisvandenbossche
Copy link
Member

The old (pre-numpy 1.13) way of doing this would be with __array_ufunc__, which is defined on our indexes.

I suppose you mean __array_wrap__ ?

@jorisvandenbossche
Copy link
Member

See also #22798 and #23293 (that last one is a PR that started implementing this, I hope to find some time soon to pick it up again).

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Feb 15, 2019 via email

@gfyoung gfyoung added Bug Datetime Datetime data dtype Timedelta Timedelta data type Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff labels Feb 18, 2019
@jreback jreback added this to the 1.0 milestone Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Bug Datetime Datetime data dtype Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants