Numpy 屬性錯(cuò)誤
求教:
在學(xué)習(xí)numpy 的數(shù)組分割時(shí),使用split屬性時(shí),提示:
AttributeError: 'numpy.ndarray' object has no attribute 'split'?
這是什么問題,numpy的版本太低嗎?
我的numpy版本是:1.13.3
python版本是:3.6.3
求教:
在學(xué)習(xí)numpy 的數(shù)組分割時(shí),使用split屬性時(shí),提示:
AttributeError: 'numpy.ndarray' object has no attribute 'split'?
這是什么問題,numpy的版本太低嗎?
我的numpy版本是:1.13.3
python版本是:3.6.3
2020-08-02
舉報(bào)
2020-09-16
split/vsplit/hsplit是numpy的方法,需要用numpy.split形式調(diào)用
import numpy as np
a=np.arange(12).reshape(3,4)
np.split(a,3,axis=0)
np.vsplit(a,3)與上述同樣效果