When inf values are present in an array, under certain conditions np.percentile can return NaN as the median, whereas np.median can return a finite value.
>>> import numpy as np
>>> np.percentile([np.inf, 5, 4], [10, 20, 30, 40, 50, 60, 70, 80, 90])
/Users/tom/miniconda3/envs/alldev/lib/python3.7/site-packages/numpy-1.16.0.dev0+45718fd-py3.7-macosx-10.7-x86_64.egg/numpy/lib/function_base.py:3947: RuntimeWarning: invalid value encountered in multiply
x2 = take(ap, indices_above, axis=axis) * weights_above
array([4.2, 4.4, 4.6, 4.8, nan, inf, inf, inf, inf])
>>> np.median([np.inf, 5, 4])
5.0
In this case, np.median is able to correctly return 5.0 as the median value, whereas np.percentile returns NaN for the 50th percentile.