<div dir="ltr">Agreed -- this would be really nice to have. For now, the best you can do is something like the following:<div><br></div><div><div><br></div><div>def is_na(x):</div><div>    x = np.asarray(x)</div><div>    if np.issubdtype(x.dtype, (np.datetime64, np.timedelta64)):  # ugh</div><div>        int_min = np.iinfo(np.int64).min</div><div>        return x.view('int64') == int_min</div><div>    else:</div><div>        return np.isnan(x)</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 18, 2016 at 3:39 PM, Gerrit Holl <span dir="ltr"><<a href="mailto:gerrit.holl@gmail.com" target="_blank">gerrit.holl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 18 July 2016 at 22:20, Scott Sanderson <<a href="mailto:ssanderson@quantopian.com">ssanderson@quantopian.com</a>> wrote:<br>
> I'm working on upgrading Zipline (<a href="http://github.com/quantopian/zipline" rel="noreferrer" target="_blank">github.com/quantopian/zipline</a>) to the<br>
> latest numpy, and I'm getting a FutureWarnings about the upcoming change in<br>
> the behavior of comparisons on np.NaT.  I'd like to be able to do checks for<br>
> NaT in a way that's forwards-compatible, but I couldn't find a function<br>
> analogous to `np.isnan` for NaT.  Am I missing something that already<br>
> exists?  If not, is there interest in such a function? I'd like to be able<br>
> to pre-emptively fix the warnings in Zipline so that we're ready when the<br>
> change actually happens, but it doesn't seem like the necessary tools are<br>
> available right now.<br>
<br>
</span>Hi Scott,<br>
<br>
see <a href="https://github.com/numpy/numpy/issues/5610" rel="noreferrer" target="_blank">https://github.com/numpy/numpy/issues/5610</a><br>
<br>
Gerrit.<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div><br></div>