-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Open
Labels
Description
When trying gh-4434, I ran into a force-cast difference between timedelta force casting and timedelta item assignment. There is also a discrepancy for float64 vs. python floats:
In [12]: np.array(3.).astype('timedelta64[D]')
Out[12]: array(datetime.timedelta(3), dtype='timedelta64[D]')
In [13]: np.array(3., dtype='timedelta64[D]')
ValueError: Could not convert object to NumPy timedelta
and:
In [17]: np.empty(1, dtype='timedelta64[D]')[[0]] = np.float64(3.)
In [18]: np.empty(1, dtype='timedelta64[D]')[0] = np.float64(3.)
ValueError: Could not convert object to NumPy timedelta
I could easily hack around this by adding an ellipsis, but this all seems a bit weird...
tjnd89, thesofakillers, claire-loves-data and shubhams