A Guide to Using NumPy Functions on Arrays
Slicing and indexing with NumPy arrays, matrix operations and more..
When arrays need to be manipulated by mathematical operations, you just need to apply the operation on the array with respect to a numerical constant (a scalar) or an array of the exact same shape:
import numpy as np
a = np.arange(5).reshape(1,5)
a += 1…