Closed
Description
Tests in astropy (astropy/astropy#5629) uncovered a bug in np.ma.median
for the case where the median should be the mean of the two entries nearest the median:
np.ma.median(np.ma.MaskedArray([1., 1.]))
# 2.0
np.ma.median(np.ma.MaskedArray([1., 1., 1.]))
# 1.0
np.ma.median(np.ma.MaskedArray([0., 1., 1., 5.]))
# 2.0
The bug is not present in 1.11.2.
I have not yet investigated where the problem occurs, as it may be that this immediately rings a bell for @juliantaylor, who last seems to have committed to np.ma.extras