A NaT position from NumPy nanargmin: inspect the original mask before handing off the minimum
Check the selected position together with its original validity so a NaT index is not handed off as the minimum observation.
An incorrect selection within bounds
Check the selected position together with its original validity so a NaT index is not handed off as the minimum observation. Keep stable row IDs and original positions in Truthound inputs. An index within array bounds does not establish a valid observation at that position. [1, 2, 3]
Different missing-value paths
NumPy #33207 reports nanargmin and nanargmax returning a NaT position on datetime64, while nanmin and related paths skip it. Distinguish plain argmin missing-value propagation from the skip expectation of the nan forms. A working reduction does not validate another arg-reduction. This is the public main report, not a new execution for this article. [1]
Preserve original positions
Preserve raw times, the NaT mask and stable row IDs, then derive the minimum position independently from valid times. Hold a selected observation if its position differs or it is NaT. Save the original position before filtering and map subset positions back. All-NaT input requires a separate no-data or failure policy. [1, 3]
An independent reference from three slots
The illustrative array is [2020-03-15,NaT,2020-01-01]. Its earliest valid date is at original zero-based position 2, so expected index is 2. Observed 2 meets the selection condition; 1 points to NaT and fails. This defines an independent fixture rather than a newly measured NumPy result. [1, 3]
Compare prepared position tables
Truthound Core Python SDK 3.3.2 can compare prepared reference_min_position and selected_original_position using ColumnPairValidator with relationship="==". The operator supplies the masked reference and original-position mapping and checks selected-value validity separately. The SDK does not repair nanargmin or invent missing dates. [1, 2, 3]
The final check before observation handoff
Use a verified valid-mask and argmin path, agreeing on tie handling as well. Existing reconciliation of positions and masks for the same dtype and consumer path can reduce the value of another check. Keep a NaT position out of the ordinary minimum-observation record. [1, 3]
Application conditions
Preserve original positions and masks before conversion, handling all-NaT input under a separate failure or no-data policy.
Alternatives
Use a verified argmin on the valid subset and map its result back to the original position.
Limitations
Core compares externally derived positions, does not repair nanargmin and cannot infer validity from counts or index bounds.
Evidence
- Event checked
- Subject checked
- Modified
