例如,我有一段代码:
import numpy as np
from numba import njit
d = np.array(['2001-01-01T12:00', '2002-02-03T13:56:03.172'],
dtype='datetime64')
@njit
def datetime_operand(date):
x = date[1] - date[0]
return x
datetime_operand(d) // the result is numpy.timedelta64(34394163172,'ms')
简单的选项如np.int64(x)
并不起作用。