Write a NumPy program to calculate average values of two given numpy arrays.
import numpy as np array1 = [[0, 1], [2, 3]] array2 = [[4, 5], [0, 3]] print("Original arrays:") print(array1) print(array2) print("Average values of two said numpy arrays:") result = (np.array(array1) + np.array(array2)) / 2 print(result)
Sample Output:
Original arrays: [[0, 1], [2, 3]] [[4, 5], [0, 3]] Average values of two said numpy arrays: [[2. 3.] [1. 3.]]
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer