Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (NumPy) expand_more
NumPy / Shape & Indexing

ndim, shape, and size

Learn ndim, shape, and size in NumPy with a dedicated explanation, a concept-specific example, practical cautions, and a mastery check.

12 min read • Beginner
numpy-009.py
python
import numpy as np
cube = np.arange(24).reshape(2, 3, 4)
print(cube.ndim, cube.shape, cube.size)
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content