numpy数组生成TypeError:“列表”对象不可调用

2024-09-28 20:54:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我认为这很简单,但我无法在网上找到以下代码给出错误原因的解决方案 “”“

import numpy as np
b = np.array([1,2,3])     # a 1D array initialised using a list [1,2,3]
Traceback (most recent call last):

  File "<ipython-input-36-8be511509d7b>", line 1, in <module>
    b = np.array([1,2,3])     # a 1D array initialised using a list [1,2,3]

TypeError: 'list' object is not callable
"""

Tags: 代码importnumpymostas错误np原因