疑难杂症之Python——'numpy.ndarray' object has no attribute 'array'

利用python内置列表创建NumPy数组时报错:
‘numpy.ndarray’ object has no attribute ‘array’
疑难杂症之Python——'numpy.ndarray' object has no attribute 'array'_第1张图片怀疑是Jupyter notebook抽风了,果然重新调用numpy就解决了:
疑难杂症之Python——'numpy.ndarray' object has no attribute 'array'_第2张图片当然,得警惕:别把Python内置的array和NumPy中的array搞混!这是报错高发地!

你可能感兴趣的:(疑难杂症)