0Pricing
Data Science Academy · Lesson

Shape, Size, and dtype

Reading the anatomy of an array.

Read the Array's Anatomy

Every array carries metadata about itself. Three labels tell you almost everything: its shape, its size, and its dtype. Let's read each one. 🔍

Shape: Rows and Columns

The shape is a tuple of dimension lengths. A 3-by-4 grid reports (3, 4): three rows down, four columns across.

a = np.zeros((3, 4))
a.shape  # (3, 4)

All lessons in this course

  1. From Python List to ndarray
  2. Shape, Size, and dtype
  3. Vectorized Math Without Loops
  4. Indexing and Slicing Arrays
← Back to Data Science Academy