You can create a 3D array containing your 2D arrays to be averaged, then average along axis=0 using np.mean or np.average (the latter allows for weighted averages):

np.mean( np.array([ old_set, new_set ]), axis=0 )

This averaging scheme can be applied to any (n)-dimensional array, because the created (n+1)-dimensional array will always contain the original arrays to be averaged along its axis=0.

Answer from Saullo G. P. Castro on Stack Overflow
๐ŸŒ
w3resource
w3resource.com โ€บ python-exercises โ€บ numpy โ€บ python-numpy-exercise-158.php
Python NumPy: Calculate average values of two given numpy arrays - w3resource
August 29, 2025 - Write a NumPy program to compute the element-wise average of two matrices and verify the output dimensions. Create a function that takes two arrays and returns a new array representing their arithmetic mean.
Discussions

Average multiple arrays in loop
Hello everyone, I have some images and for each image I calculate an array using a function in a loop. Is there a way to make the average of the arrays I created to have one array for all the images? What I was thinking is to store each array in a big array (WHICH FUNCTION?) with total length ... More on forum.image.sc
๐ŸŒ forum.image.sc
7
0
July 5, 2017
python - How to calculate Average of n numpy arrays - Stack Overflow
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... Save this question. Show activity on this post. ... Closed 7 years ago. I have 'n' numpy arrays each with shape (128,) How to get an average numpy array of shape (128,) for the list of numpy arrays. More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - Elementwise aggregation (average) of values in a list of numpy arrays with same shape - Stack Overflow
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... Save this question. Show activity on this post. ... Closed 8 years ago. I have a list of numpy arrays. I want to calculate the average of values in these arrays. More on stackoverflow.com
๐ŸŒ stackoverflow.com
How can I average an array of arrays in python? - Stack Overflow
I have a simulation that runs over many times. Each time an array is produced and I insert it into a larger array keeping track of all the data. for example record = [] for i in range(2): r = More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
IncludeHelp
includehelp.com โ€บ python โ€บ calculate-average-values-of-two-given-numpy-arrays.aspx
Python - Calculate average values of two given NumPy arrays
Suppose we have a series of numbers from 1 to 10, then the average of this series will be: โˆ‘x = 1+2+3+4+5+6+7+8+9+10 โˆ‘x = 55 n = 10 xฬ„ = 55/10 xฬ„ = 5.5 ... # Import numpy import numpy as np # Creating two numpy arrays arr1 = [[0, 1], [4, 5]] arr2 = [[2, 7], [0, 1]] # Display original ...
๐ŸŒ
Image.sc
forum.image.sc โ€บ usage & issues
Average multiple arrays in loop - Usage & Issues - Image.sc Forum
July 5, 2017 - What I was thinking is to store ... make the mean of the elements 0: (array length+i):total length (from 0 to total length with array length +i step), where i =( 0,1,2,3โ€ฆarray length)....
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ calculate-average-values-of-two-given-numpy-arrays
Calculate average values of two given NumPy arrays | GeeksforGeeks
August 20, 2020 - For doing our task, we will some inbuilt methods provided by NumPy module which are as follows: numpy.average() to calculate the average i.e the sum of all the numbers divided by the number of elementsnumpy ... In this article, we are going to learn how to remove Nan values from a given array.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ stable โ€บ reference โ€บ generated โ€บ numpy.average.html
numpy.average โ€” NumPy v2.5 Manual
If axis is a tuple of ints, averaging is performed on all of the axes specified in the tuple instead of a single axis or all the axes as before. ... An array of weights associated with the values in a. Each value in a contributes to the average according to its associated weight.
Find elsewhere
๐ŸŒ
Finxter
blog.finxter.com โ€บ home โ€บ learn python blog โ€บ how to calculate the average of a numpy 2d array?
How to Calculate the Average of a NumPy 2D Array? - Be on the Right Side of Change
November 11, 2023 - Note that NumPy calculates the average as the sum of all values divided by the number of values. The result is a float value. Are you a master coder? Test your skills now! Note that the following tutorial may be interesting to you too: ๐Ÿ‘‰ ...
๐ŸŒ
Python Examples
pythonexamples.org โ€บ python-numpy-average
Average of NumPy Array - Examples
Using NumPy, you can calculate the average of elements for an entire NumPy array, along a specific axis, or as a weighted average of elements.
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ python โ€บ third party โ€บ numpy โ€บ average()
Python Numpy average() - Compute Mean Value
November 11, 2024 - The average() function from the NumPy library is essential for computing the mean value of data elements in an array or along a specific axis of a multidimensional array.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ 2.1 โ€บ reference โ€บ generated โ€บ numpy.average.html
numpy.average โ€” NumPy v2.1 Manual
If axis is a tuple of ints, averaging is performed on all of the axes specified in the tuple instead of a single axis or all the axes as before. ... An array of weights associated with the values in a. Each value in a contributes to the average according to its associated weight.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ stable โ€บ reference โ€บ generated โ€บ numpy.mean.html
numpy.mean โ€” NumPy v2.5 Manual
Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis.
๐ŸŒ
Moonbooks
en.moonbooks.org โ€บ Articles โ€บ How-to-calculate-the-element-wise-mean-across-multiple-numpy-arrays-in-Python-
How to calculate the element-wise mean across multiple numpy arrays in Python ?
December 2, 2023 - To calculate the element-wise mean of a numpy array in python, we can use the mean() function from the NumPy library: ... Note that the axis parameter allows us to specify which axis we want to calculate the mean along. By default, it is set to None, which means the function will calculate ...
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ numpy โ€บ methods โ€บ average
NumPy average()
The numpy.average() method computes the weighted average along the specified axis. import numpy as np # create an array array1 = np.array([0, 1, 2, 3, 4, 5, 6, 7])
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ 2.0 โ€บ reference โ€บ generated โ€บ numpy.average.html
numpy.average โ€” NumPy v2.0 Manual
If axis is a tuple of ints, averaging is performed on all of the axes specified in the tuple instead of a single axis or all the axes as before. ... An array of weights associated with the values in a. Each value in a contributes to the average according to its associated weight.