x = np.array([[-1, 1], [-2, 2]]) y = np.array([-10, 10]) print(x * y) # Universal function x = np.array([[0, 1], [2, 3]]) print(np.square(x), end='\n\n') print(np.sin(x)) print(x.sum(), end='\n\n') print(x.sum(axis=0), end='\n\n') # can use axis to sum a specific dimension print(x.sum(axis=1)) x = np.arange(30).reshape(5, 6) print(x.argmax(axis=1)) # Return indices of maximum value along the axis # Create a array x of shape (5, 6), having random integers between -30 and 30 x = np.random.randint(-30, 30, size=(5, 6)) print(x) # Compute the mean, standard deviation, and variance numpy.mean(), numpy.std(), numpy.var() x = 10 + 2 * np.random.randn(3) # mean 10 and stansard deviation. print(np.mean(x)) print(np.std(x))