So, timedeltafor dtype is np.longdoublenot implemented?
In short, yes.
From the documentation :
class datetime.timedelta ([days [, seconds [, microseconds [, [, [, [, ]]]]]]])
0. ints, longs floats .
"long" Python long, float longdouble.
Update
, , , np.float64.
, -, , numpy dtype Python, timedelta .
64- , Python 2.7.9, numpy v1.10.1:
In [1]: timedelta(np.float64(1))
Out[1]: datetime.timedelta(1)
In [2]: timedelta(np.float32(1))
TypeError Traceback (most recent call last)
<ipython-input-2-4a7874ba393b> in <module>()
TypeError: unsupported type for timedelta days component: numpy.float32
In [3]: timedelta(np.int64(1))
Out[3]: datetime.timedelta(1)
In [4]: timedelta(np.int32(1))
TypeError Traceback (most recent call last)
<ipython-input-4-0475c6c8f1aa> in <module>()
TypeError: unsupported type for timedelta days component: numpy.int32
In [5]: issubclass(np.float64, float)
Out[5]: True
In [6]: issubclass(np.float32, float)
Out[6]: False
In [7]: issubclass(np.int64, int)
Out[7]: True
In [8]: issubclass(np.int32, int)
Out[8]: False
OP , timedelta(np.int64(1)) Python 3.4.3. , , , numpy Python 3x, np.int64 int.
Python 3.4.3:
In [1]: timedelta(np.int64(1))
TypeError Traceback (most recent call last)
<ipython-input-1-9902ea26a52d> in <module>()
TypeError: unsupported type for timedelta days component: numpy.int64
In [2]: issubclass(np.int64, int)
Out[2]: False