There is a [ptp](https://docs.scipy.org/doc/numpy/reference/generated/numpy.ptp.html) function but it will fail when there are `nan` values in the array.