On 17 June 2015 at 22:44, Abraham Escalante <aeklant@gmail.com> wrote:
Of course, before we deprecate anything, we would like to know if anyone in the community is a regular user of this function and/or if you guys may have a use case where it may be preferable to use `stats.threshold` over `np.clip`.

I wasn't aware of this function, so I am not using it, but I could see one case. In astronomical data (magnitudes), sometimes missing data is represented by 99, -99, 999, 99.99... or variations; and more often than one would wish, the same file contains different filling values.

So, what I do:

arr[np.abs(arr) < 50] = np.nan

Can be replaced by:

stats.threshold(arr, -50, 50, np.nan)

This said, I don't think Scipy's version adds anything new, or enhances readability. After all, all it is doing is a straightforward application of a mask; the user can do the same by hand in a more flexible way.

So, in summary, I am for the deprecation.


/David.