Run
import numpy as np data = np.array([[5, 8, 10], [12, 15, 18]]) variance_along_axis0 = np.var(data, axis=0) variance_along_axis1 = np.var(data, axis=1) print("Variance along Axis 0:", variance_along_axis0) print("Variance along Axis 1:", variance_along_axis1)
Output