Thanks to visit codestin.com
Credit goes to github.com

Skip to content

API: NaT (arg)min/max behavior #14717

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

Merged
merged 4 commits into from
Oct 16, 2019
Merged

API: NaT (arg)min/max behavior #14717

merged 4 commits into from
Oct 16, 2019

Conversation

zjpoh
Copy link
Member

@zjpoh zjpoh commented Oct 15, 2019

Fix #12797.

As discussed, we want argmin/argmax/min/max to return NaT when it exists in the array.

I modified some previous test cases that ignores NaT. I also combined the DATETIME_argmin function with more general argmin function. So that it is consistent with argmax.

@@ -3103,6 +3104,12 @@ static int
return 0;
}
#endif
#if @isdatetime@
if (mp == NPY_DATETIME_NAT) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: four spaces here not three

@@ -3122,6 +3129,13 @@ static int
}
}
#else
#if @isdatetime@
if (*ip == NPY_DATETIME_NAT) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: Missing space

@eric-wieser eric-wieser changed the title MAINT: NaT (arg)min/max behavior API: NaT (arg)min/max behavior Oct 15, 2019
@seberg seberg self-requested a review October 16, 2019 00:01
@seberg seberg merged commit 67fc362 into numpy:master Oct 16, 2019
@zjpoh zjpoh deleted the nat_min_max branch October 16, 2019 03:38
twsearle added a commit to twsearle/forest that referenced this pull request Feb 7, 2020
This is to avoid a change at version 1.18 (PR 14717), which is
incompatible with our use of numpy.ma.argmax on a datetime64 array
containing `NaT` (not a time) fill values.

Specifically, `satellite.py: Locator.find_index` was returning indices
at fill value locations.

Numpy PR here: numpy/numpy#14717
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MAINT: NaT (arg)min/max behavior
3 participants