🌐
W3Schools
w3schools.com › python › numpy › numpy_array_shape.asp
NumPy Array Shape
The shape of an array is the number of elements in each dimension. NumPy arrays have an attribute called shape that returns a tuple with each index having the number of corresponding elements.
Spaces
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
Practice
Practice coding problems on W3Schools. Write code, submit, and get instant feedback.
W3Schools app iOS & Android NEW
The W3Schools app turns coding fundamentals into a game. Bite-sized lessons, streaks and XP. Free on iOS and Android.
Python For Loops
A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).
🌐
W3Schools
w3schools.com › python › numpy › numpy_array_reshape.asp
NumPy Array Reshaping
The shape of an array is the number of elements in each dimension. By reshaping we can add or remove dimensions or change number of elements in each dimension. Convert the following 1-D array with 12 elements into a 2-D array.
🌐
W3Schools
w3schools.com › python › numpy › trypython.asp
W3Schools online PYTHON editor
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
W3Schools
w3schools.com › python › numpy › default.asp
NumPy Tutorial
NumPy HOME NumPy Intro NumPy Getting Started NumPy Creating Arrays NumPy Array Indexing NumPy Array Slicing NumPy Data Types NumPy Copy vs View NumPy Array Shape NumPy Array Reshape NumPy Array Iterating NumPy Array Join NumPy Array Split NumPy Array Search NumPy Array Sort NumPy Array Filter
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-array-shape
NumPy Array Shape - GeeksforGeeks
July 15, 2025 - Dimension is the number of indices ... array. In NumPy, we will use an attribute called shape which returns a tuple, the elements of the tuple give the lengths of the corresponding array dimensions....
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.shape.html
numpy.shape — NumPy v2.6.dev0 Manual
Return the shape of an array · The elements of the shape tuple give the lengths of the corresponding array dimensions
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
NumPy: Get the dimensions, shape, and size of an array | note.nkmk.me
April 23, 2025 - NumPy: Add new dimensions to an array (np.newaxis, np.expand_dims) The shape of a NumPy array, i.e., the length of each dimension, is represented as a tuple and can be accessed using the shape attribute.
🌐
W3Schools
w3schools.com › python › numpy › numpy_intro.asp
Introduction to NumPy
NumPy HOME NumPy Intro NumPy Getting Started NumPy Creating Arrays NumPy Array Indexing NumPy Array Slicing NumPy Data Types NumPy Copy vs View NumPy Array Shape NumPy Array Reshape NumPy Array Iterating NumPy Array Join NumPy Array Split NumPy Array Search NumPy Array Sort NumPy Array Filter
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.ndarray.shape.html
numpy.ndarray.shape — NumPy v2.5 Manual
The shape property is usually used to get the current shape of an array, but may also be used to reshape the array in-place by assigning a tuple of array dimensions to it. As with numpy.reshape, one of the new shape dimensions can be -1, in which case its value is inferred from the size of ...
Find elsewhere
🌐
Programiz
programiz.com › python-programming › numpy › methods › shape
NumPy shape() | Programiz
August 30, 2023 - The shape() method returns the shape of an array i.e. the number of elements in each dimension. import numpy as np array = np.array([[0, 1], [2, 3]])
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.shape.html
numpy.shape — NumPy v2.5 Manual
Return the shape of an array · The elements of the shape tuple give the lengths of the corresponding array dimensions
🌐
W3Schools
w3schools.com › python › numpy › numpy_data_types.asp
NumPy Data Types
NumPy HOME NumPy Intro NumPy Getting Started NumPy Creating Arrays NumPy Array Indexing NumPy Array Slicing NumPy Data Types NumPy Copy vs View NumPy Array Shape NumPy Array Reshape NumPy Array Iterating NumPy Array Join NumPy Array Split NumPy Array Search NumPy Array Sort NumPy Array Filter
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.shape.html
numpy.shape — NumPy v2.3 Manual
Return the shape of an array · The elements of the shape tuple give the lengths of the corresponding array dimensions
🌐
Medium
medium.com › @amit25173 › understanding-numpy-shape-6fbb6b83891e
Understanding numpy.shape. If you think you need to spend $2,000… | by Amit Yadav | Medium
February 9, 2025 - For a 1D array, the shape might look like (n,), where n is the number of elements. For a 3D array, it could look like (x, y, z), representing depth, rows, and columns. Here’s another quick example to make it more fun. You might wonder: “What if I have a 3D array?” Let’s explore that: # Creating a 3D NumPy array array_3d = np.array([ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]) print("3D Array Shape:", array_3d.shape)
🌐
Hyperskill
hyperskill.org › university › numpy › numpy-array-shape
NumPy Array Shape
September 4, 2024 - The array shape in NumPy defines the structure and organization of the array. It indicates the number of elements in each dimension and is accessed using the .shape attribute, which returns a tuple representing the array's dimensions.
🌐
W3Schools
w3schools.com › python › numpy › numpy_creating_arrays.asp
NumPy Creating Arrays
We can create a NumPy ndarray object by using the array() function.
🌐
Codecademy
codecademy.com › docs › python:numpy › ndarray › .shape
Python:NumPy | ndarray | .shape | Codecademy
October 30, 2025 - The .shape attribute of a NumPy ndarray returns a tuple of integers specifying the size of the array in each dimension.
🌐
Indian AI Production
indianaiproduction.com › home › blog › python numpy shape – python numpy tutorial
Python NumPy shape - Python NumPy Tutorial
June 14, 2019 - The NumPy shape function helps to find the number of rows and columns of python NumPy array. The numpy.shape() function gives output in form of tuple.
🌐
YouTube
youtube.com › watch
NumPy Array Shape | Python NumPy Array Shape | NumPy Shape Function - YouTube
NumPy Array Shape | Python Numpy Array Shape | Numpy Shape FunctionGet the Shape of an Array. NumPy arrays have an attribute called shape that returns a tupl...
Published: January 2, 2024