[Numpy-discussion] masked_values behaviour

Marten van Kerkwijk m.h.vankerkwijk at gmail.com
Sat Dec 16 16:48:09 EST 2017


Definitely a big! The underlying problem is:
```
In [23]: np.abs(np.int16(-32768))
Out[23]: -32768
```
This is not great, but perhaps consistent with the logic that abs
should return a value of the same dtype.

It could be solved inside `masked_values` by using `np.abs(value,
dtype=xnew.dtype)`

Do you want to have a go at fixing this? Or raise an issue at
https://github.com/numpy/numpy

-- Marten


More information about the NumPy-Discussion mailing list