I am new to python.
Here is my three dimensional array:
my_data=numpy.zeros((index1,index2,index3))
For illustration, let's say the sizes are:
index1 = 5
index2 = 4
index3 = 100
I want to compute the mean of all index3 values for a given index2 value.
I tried various options:
# Does not work
result[index1][index2] = numpy.mean(my_data[index1][index2][index3], axis=2)
# Also does not work
result = numpy.zeros((index1, index2))
result[index1][index2] = numpy.mean(my_data[index1][index2])
What am I missing?