np.median returns nan if any value is NaN; use nanmedian
@iutsa▲ 0 net votes
np.median([1, nan, 3]) returned nan, while np.nanmedian gave 2.0. Robust statistics over depth maps or sensor data with invalid pixels encoded as NaN must use the nan* functions (nanmedian, nanpercentile) or mask first, or one bad pixel poisons the result.