1
我想創建一個數組,並顯示它的內容並追加新的項目但是我遇到了一個錯誤:NumPy的有沒有屬性陣列
C:\Users\Dylan Galea\Desktop\Modelling and CS>python numpy.py
Traceback (most recent call last):
File "numpy.py", line 1, in <module>
import numpy as np
File "C:\Users\Dylan Galea\Desktop\Modelling and CS\numpy.py", line 2, in <module>
x=np.array([1,2,3,4])
AttributeError: module 'numpy' has no attribute 'array'
我的代碼是:
import numpy as np
x=np.array([1,2,3,4])
x=np.append([x,[5],0])
print(x)
將您的腳本從'numpy.py'重新命名爲其他東西 – L3viathan
仍然輸出相同的錯誤 –
您的目錄中沒有名爲'numpy.py'或名爲'numpy'的文件夾'正在調用腳本? – L3viathan