Calculate average values of two given NumPy arrays Last Updated : 20 Aug, 2020 Comments Improve Suggest changes Like Article Like Report Finding average of NumPy arrays is quite similar to finding average of given numbers. We just have to get the sum of corresponding array elements and then divide that sum with the total number of arrays. Let's see an example: Example 1: Calculate average values of two given NumPy 1d-arrays Python3 # import library import numpy as np # create a numpy 1d-arrays arr1 = np.array([3, 4]) arr2 = np.array([1, 0]) # find average of NumPy arrays avg = (arr1 + arr2) / 2 print("Average of NumPy arrays:\n", avg) Output: Average of NumPy arrays: [2. 2.] Example 2: Calculate average values of two given NumPy 2d-arrays Python3 # import library import numpy as np # create a numpy 2d-arrays arr1 = np.array([[3, 4], [8, 2]]) arr2 = np.array([[1, 0], [6, 6]]) # find average of NumPy arrays avg = (arr1 + arr2) / 2 print("Average of NumPy arrays:\n", avg) Output: Average of NumPy arrays: [[2. 2.] [7. 4.]] Comment More infoAdvertise with us Next Article Calculate average values of two given NumPy arrays M mayanktyagi1709 Follow Improve Article Tags : Python Python-numpy Python numpy-Linear Algebra Practice Tags : python Similar Reads Find common values between two NumPy arrays In this article, we are going to discuss how to find out the common values between 2 arrays. To find the common values, we can use the numpy.intersect1d(), which will do the intersection operation and return the common values between the 2 arrays in sorted order. Syntax: numpy.intersect1d(arr1, arr2 2 min read Find common values between two NumPy arrays In NumPy, we can find common values between two arrays with the help intersect1d(). It will take parameter two arrays and it will return an array in which all the common elements will appear. Syntax: numpy.intersect1d(array1,array2) Parameter :Two arrays. Return :An array in which all the common ele 1 min read How to calculate the element-wise absolute value of NumPy array? Let's see the program for finding the element-wise absolute value of NumPy array. For doing this task we are using numpy.absolute() function of NumPy library. This mathematical function helps to calculate the absolute value of each element in the array. Syntax: numpy.absolute(arr, out = None, ufunc 2 min read How to remove NaN values from a given NumPy array? In this article, we are going to learn how to remove Nan values from a given array. Nan values are those values that do not have a specific value associated with them or they are different from the type of values that are to be used in the declared array. There are basically three approaches with sl 3 min read How to get values of an NumPy array at certain index positions? Sometimes we need to remove values from the source Numpy array and add them at specific indices in the target array. In NumPy, we have this flexibility, we can remove values from one array and add them to another array. We can perform this operation using numpy.put() function and it can be applied t 4 min read Like