About 6,320,000 results
Open links in new tab
  1. What does .shape [] do in "for i in range (Y.shape [0])"?

    Aug 8, 2014 · shape is a tuple that gives you an indication of the number of dimensions in the array. So in your case, since the index value of Y.shape[0] is 0, your are working along the first …

  2. NumPy Shape And Array Dimensions In Python

    May 8, 2025 · Understanding NumPy’s shape attribute is essential for efficient data manipulation in Python. I covered the basic usage of NumPy shape, modifying array shape, how to get …

  3. numpy.shape — NumPy v2.3 Manual

    Return the shape of an array. Input array. The elements of the shape tuple give the lengths of the corresponding array dimensions. len(a) is equivalent to np.shape(a)[0] for N-D arrays with …

  4. Python中的shape [0]、shape [1]和shape [-1]分别是什么意思(附代码)_.shape [0 ...

    Jul 31, 2025 · shape函数是 Numpy 中的函数,它的功能是读取矩阵的长度,比如shape [0]就是读取矩阵第一维度的长度。 直接用.shape可以快速读取 矩阵 的形状,使用shape [0]读取矩阵第 …

  5. NumPy Array Shape - GeeksforGeeks

    Jul 15, 2025 · The shape of an array can be defined as the number of elements in each dimension. Dimension is the number of indices or subscripts, that we require in order to …

  6. NumPy Array Shape - W3Schools

    NumPy arrays have an attribute called shape that returns a tuple with each index having the number of corresponding elements. Print the shape of a 2-D array: The example above returns …

  7. Unveiling the Magic of `.shape` in NumPy - pythontutorials.net

    Jun 21, 2025 · The .shape attribute in NumPy is a powerful tool for understanding and manipulating multi - dimensional arrays. It provides essential information about the dimensions …