np.timedelta64不接受np.int64

时间:2016-03-25 22:05:47

标签: python datetime numpy types casting

为什么np.timedelta64不接受np.int64等numpy整数?

np.timedelta64(np.int64(2),'h')

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-75-fd40c0d8eac0> in <module>()
----> 1 np.timedelta64(np.int64(2),'h')

ValueError: Could not convert object to NumPy timedelta

0 个答案:

没有答案