astropy.utils
astropy.utils.masked
Like numpy.nanpercentile, skipping masked values as well.
numpy.nanpercentile
No warnings are given for fully masked/NaN slices. Instead, they are masked in the output.