Re: [Numpy-discussion] Problem with absolute value

2019-07-03 Thread Nicolas Rougier
Thanks for the quick explanation & answers. I was mostly puzzled by the absence of warning. In C you would get an overflow warning in such a case, no ? Nicolas > On 3 Jul 2019, at 20:01, Charles R Harris wrote: > > > > On Wed, Jul 3, 2019 at 11:39 AM Matthew Brett wrote: > Hi, > > On We

[Numpy-discussion] Problem with absolute value

2019-07-03 Thread Nicolas Rougier
Hi, I’m a bit surprised with the following code: >>> import numpy as np >>> np.seterr(all='warn') >>> Z = np.array([-128], dtype=np.byte) >>> print(np.abs(Z)) [-128] Obviously, it does not return the absolute value and I get no warning. Is it something expected ? (numpy 1.16.4, python 3.7.3)

[Numpy-discussion] Book on scientific visualization using Python & OpenGL

2018-05-06 Thread Nicolas Rougier
[Sorry for cross-posting] Hi all, I just released an (unfinished) book on "Python & OpenGL for Scientific Visualization”. It’s available at http://www.labri.fr/perso/nrougier/python-opengl/ (sources are available at https://github.com/rougier/python-opengl) Nicolas