-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Open
Labels
Description
When an array has dtype datetime64, setting to NaN should convert to NaT. Currently, it fails with ValueError:
In [49]: x = numpy.zeros(dtype="M8[s]", shape=5)
In [51]: x[2] = numpy.nan
…
ValueError: Could not convert object to NumPy datetime
The instruction = numpy.nan is not ambiguous in any way. When setting all the values of a structured dtype with floats and datetime types to nan it is much easier if we don't need to separately handle the case for nat.
kernc and JackKelly