最佳答案
在 傻瓜手册中关于重塑()函数,它说
>>> a = np.zeros((10, 2))
# A transpose make the array non-contiguous
>>> b = a.T
# Taking a view makes it possible to modify the shape without modifying the
# initial object.
>>> c = b.view()
>>> c.shape = (20)
AttributeError: incompatible shape for a non-contiguous array
我的问题是:
c.shape = (20)
抛出一个错误 incompatible shape for a non-contiguous array
?谢谢你的回答!