【发布时间】:2019-10-23 04:34:39
【问题描述】:
我正在尝试编写一个函数来初始化一个数组并在返回之前对其进行洗牌。 将 numba 导入为 nb
@nb.jit(nopython=True, cache=True)
def test(x):
ind = np.array(range(len(x)))
np.random.shuffle(ind)
return ind
错误消息说我使用了不支持的功能或数据类型:
NotImplementedError: range_state_int64 cannot be represented as a Numpy dtype
numba 是否支持 numpy.random.shuffle()?如何修改它?谢谢!
【问题讨论】:
标签: python python-2.7 numba