python 来自https://docs.scipy.org/doc/numpy/reference/generated/numpy.reshape.html#numpy.reshape的numpy

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 来自https://docs.scipy.org/doc/numpy/reference/generated/numpy.reshape.html#numpy.reshape的numpy相关的知识,希望对你有一定的参考价值。

It is not always possible to change the shape of an array without copying the data.
If you want an error to be raise if the data is copied, you should assign the new 
shape to the shape attribute of the array:

>>> 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

The order keyword gives the index ordering both for fetching the values from a
and then placing the values into the output array. For example, let’s say you have an array:

>>> a = np.arange(6).reshape((3, 2))
>>> a
array([[0, 1],
       [2, 3],
       [4, 5]])

以上是关于python 来自https://docs.scipy.org/doc/numpy/reference/generated/numpy.reshape.html#numpy.reshape的numpy的主要内容,如果未能解决你的问题,请参考以下文章

python 来自Python的Git pull

python 来自Python的os文件系统

一封来自“Python”的信

来自 Black Hat Python 书的 Python 嗅探

“路径 python3(来自 --python=python3)不存在”错误

python Python装饰模板(来自“Head First Python ed.2”)