Lesson 4 of 10 · 2 min
Array Properties
import numpy as np arr = np.array([[1, 2, 3], [4, 5, 6]]) print(arr.shape) # Output: (2, 3) — 2 rows, 3 cols print(arr.ndim) # Output: 2 — 2 dimensions print(arr.size) # Output: 6 — total elements print(arr.dtype) # Output: int64
