Lesson 7 of 60
pythonNumPy Arrays and Data Types
15 minutes
Course progress12%
NumPy Arrays and Data Types
NumPy arrays (ndarray) are homogeneous – every element shares the same data type (dtype).
Creating arrays of different dims
import numpy as np
# 1‑D array (vector)
vec = np.arange(5) # [0 1 2 3 4]
# 2‑D array (matrix)
mat = np.arange().reshape(,)
(mat)
tensor = np.arange().reshape(,,)
(tensor.shape)