Closed
Description
a = np.ma.masked_array(np.array([], dtype=float, ndmin=3))
np.ma.median(a, axis=2)
fails with
IndexError: index -1 is out of bounds for axis 2 with size 0
As integer indexing of empty slices does not work.
Normal median slices instead and returns the mean of an empty slice, so nan.
What should masked median return? a masked nan to somewhat match the normal median or an empty array again?