I have an array called "all_data" that looks like this:
array([[[102, 107, 111],
[101, 106, 110],
[100, 105, 109],
...,
[221, 166, 99],
[221, 166, 99],
[221, 166, 99]],
[[ 95, 100, 104],
[ 98, 103, 107],
[102, 107, 111],
...,
[219, 165, 95],
[218, 164, 94],
[218, 164, 94]]])
My goal is to take the average of each of the column values of the same index. For example, since this larger array has 2 2d arrays (though my data can have up to 200 2d arrays that would need to be averaged), the end result of averaging would be 1 2d array with the first sublist being [98.5, 103.5, 107.5]
When I try to use numpy and do all_data.mean(axis=2), I get an array that looks like this unusually:
array([[106.66666667, 105.66666667, 104.66666667, ..., 162. ,
162. , 162. ],
[ 99.66666667, 102.66666667, 106.66666667, ..., 159.66666667,
158.66666667, 158.66666667]])
I'm not sure what the problem is because I thought it should be averaging the column values for each sublist, but something different is happening.
Any help would be appreciated
axis=1instead.outeris a list of 2d arrays,midis a 2d array, andinneris a normal list? and you want to get the average for each column of each 2d array? how organized?