Closed
Description
Snippet:
import numpy as np
masked_arr = np.ma.masked_array([[5.], [0.], [0.]],
[[False], [True], [True]])
print('masked_arr\n', masked_arr)
print('median\n', np.ma.median(masked_arr, axis=0))
Output:
numpy 1.11.1
[[5.0]
[--]
[--]]
median
[ 5.]
The median is 5. as expected since this is the only non-masked value.
numpy master
masked_arr
[[5.0]
[--]
[--]]
median
[2.5]
The median is 2.5, unexpectedly.
FWIW, the result is fine when not using an axis
argument.
Metadata
Metadata
Assignees
Labels
No labels