Reputation: 79
I want to calculate theoretical value of 2D array.I have a 2D array like arr = [[1,3,4],[5,7,9],[8,1,7]]
So this 2D array's theoretical array is [5,3,7] I tried to get the array by the code
theory = np.median(arr)
but when I print out theory, only 4.67 is returned.I read numpy document ,median method can be gotten array. What is wrong in my code?How should I fix this?
Upvotes: 0
Views: 32
Reputation: 1629
This will calculate the median over the rows.
numpy.median(arr, axis=0)
Upvotes: 1