Skip to content

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.

}
#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

}
#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