Closed
Description
Example:
In [1]: np.__version__
Out[1]: '1.10.0.dev0+a92c4a1'
In [2]: x = np.array([ -91, -119, -137, -132], dtype=np.int16)
In [3]: np.linalg.norm(x)
/Users/warren/local_scipy/lib/python2.7/site-packages/numpy/linalg/linalg.py:2126: RuntimeWarning: invalid value encountered in sqrt
ret = sqrt(sqnorm)
Out[3]: nan
The example is from http://stackoverflow.com/questions/31685156/normalizing-vector-produces-nan-in-numpy, although it is not clear in that question if the array has type int16.
Metadata
Metadata
Assignees
Labels
No labels