导入错误:无法导入名称random_integers。

3

我有一段包含以下代码行的 Python 代码:

from numpy import array,arccosh,random_integers

代码后面我成功地使用了arrayarccosh。然而,在运行程序时出现了错误:

from numpy import array,arccosh,random_integers
ImportError: cannot import name random_integers

有人可以帮忙吗? 谢谢。

1个回答

5

我对NumPy没有经验,但是通过快速的谷歌搜索得知random_integers实际上在numpy.random中。所以,也许可以使用from numpy.random import random_integers


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接