# Import the NumPy library import numpy as np arr = np.random.randint(0, 10, size=(3,3)) row_means = np.mean(arr, axis=1) arr_mean = arr - row_means[:, np.newaxis] print(arr_mean)