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

ENH: add quantile support for datetime64 #11627

Closed
wants to merge 5 commits into from

Conversation

holymonson
Copy link

@holymonson holymonson commented Jul 27, 2018

@eric-wieser, Is this OK? No explicit rounding.

close #11620

Copy link
Contributor

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be helpful to add some tests to this potential contribution as well--I see that you've started discussing input and expected output with Eric in the linked issue so that might be a starting point.

@holymonson
Copy link
Author

@tylerjereddy, testcase added. Travis CI reports false fail, please rebuild.

@tylerjereddy
Copy link
Contributor

Ok, I restarted the failing Python 3.7 job in Travis

@shoyer
Copy link
Member

shoyer commented Aug 3, 2018

A couple of thoughts:

  • Consider casting to timedelta64 directly (e.g., dates.view('timedelta64')) instead of adding/subtracting an offset. This should be equivalent but more efficient.
  • Please add tests to make sure that NaT is handled properly (like NaN).

@holymonson
Copy link
Author

holymonson commented Aug 5, 2018

New commit with using view and adding testcase.

@eric-wieser eric-wieser added the component: numpy.datetime64 (and timedelta64) label Apr 23, 2019
Base automatically changed from master to main March 4, 2021 02:04
@seberg seberg added the 57 - Close? Issues which may be closable unless discussion continued label Jun 10, 2022
@seberg
Copy link
Member

seberg commented Jun 10, 2022

This is currently supported. However, I do not think we have any tests, so it would be great to recover (and maybe add to those). It may be tested downstream but I am not certain.

There is also the question of rounding that was brought up here, I am not immediately sure if this is a problem with our linear interpolation formula and datetime/timedelta inputs; it might be nice to vet it.

The handling of NaT is still broken, I suspect the fix should be closer to what we do for NaNs gh-20376 open about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 - Enhancement 57 - Close? Issues which may be closable unless discussion continued component: numpy.datetime64 (and timedelta64) component: numpy.lib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

percentile don't support datetime64
5 participants