I have a very large array containing lists, each with 364 values of daily cumulative rainfall for the years 1988-2018. I would like to calculate a mean for each day in this array, with the output being 364 values in an array, each value containing the mean for that day. Below is an example of the structure of my data and my desired outcome:
var array1 = [1,3,6,8,12,24,4,2,10,11,13]
var array2 = [5,9,2,18,10,2,6,8,4,3,3]
var arrays = [array1, array2]
var arrayMean = [3,6,4,13,11,13,5,5,7,7,8]
The arrayMean
variable contains a list of values equally long to the input arrays, but with the mean for each value.
How do I perform this type of calculation?