numpy基础——ndarray.shape
来源:互联网 发布:免费刷空间人气软件 编辑:程序博客网 时间:2024/06/09 19:48
numpy.ndarray.shape
ndarray.shape
Tuple of array dimensions.
获得数组维度的 tuple
Notes
May be used to “reshape” the array, as long as this would not require a change in the total number of elements
Examples
>>> x = np.array([1, 2, 3, 4])>>> x.shape(4,)>>> y = np.zeros((2, 3, 4))>>> y.shape(2, 3, 4)>>> y.shape = (3, 8)>>> yarray([[ 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0.]])>>> y.shape = (3, 6)Traceback (most recent call last): File "<stdin>", line 1, in <module>ValueError: total size of new array must be unchanged
https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.shape.html
阅读全文
1 0
- numpy基础——ndarray.shape
- numpy基础——ndarray对象属性
- numpy基础——ndarray对象方法
- numpy基础——关于 ndarray 的一些尝试
- NumPy基础--ndarray
- 从numpy.ndarray.shape到numpy.ndarray.transpose
- numpy基础学习-ndarray对象
- Python基础——numpy.ndarray一维数组与多维数组
- NumPy基础 -- 1. ndarray (多维数组对象)
- Numpy——ndarray对象(1):创建数组
- NumPy的ndArray——多维数组对象
- nditer —— numpy.ndarray 多维数组的迭代
- numpy.ndarray
- numpy -- ndarray
- ndarray.Numpy
- python:NumPy基础(1),ndarray多维数组对象
- Numpy——ndarray对象(2):数组存取和多维数组
- numpy中的ndarray对象
- Python基础——使字典按照 items 的大小进行排序
- 对js对象和原型的理解
- HDU -- 5071 Chat 超强模拟
- Python:矩形覆盖
- 并发队列-无界非阻塞队列 ConcurrentLinkedQueue 原理探究
- numpy基础——ndarray.shape
- StringBuffer的用法
- Python基础—— dict.get() 与 dict['key'] 的区别
- Leetcode Basic Calculator I && II
- 并发队列 – 无界阻塞队列 LinkedBlockingQueue 原理探究
- tensorflow.nn.bidirectional_dynamic_rnn()函数的用法
- Student Attendance Record I
- 排序、树和图
- Java提高篇——单例模式