Re: [Numpy-discussion] round(numpy.float64(0.0)) is a numpy.float64

2018-03-26 Thread Robert Kern
On Mon, Mar 26, 2018 at 10:03 PM, wrote: > > On Mon, Mar 26, 2018 at 10:29 PM, Robert Kern wrote: > > On Mon, Mar 26, 2018 at 6:28 PM, Nathaniel Smith wrote: > >> > >> On Mon, Mar 26, 2018 at 6:24 PM, Nathaniel Smith wrote: > >> > Even knowing that, it's still confusing that round(np.float64(0.

Re: [Numpy-discussion] round(numpy.float64(0.0)) is a numpy.float64

2018-03-26 Thread josef . pktd
On Mon, Mar 26, 2018 at 10:29 PM, Robert Kern wrote: > On Mon, Mar 26, 2018 at 6:28 PM, Nathaniel Smith wrote: >> >> On Mon, Mar 26, 2018 at 6:24 PM, Nathaniel Smith wrote: >> > Even knowing that, it's still confusing that round(np.float64(0.0)) >> > isn't the same as round(0.0). The reason is a

Re: [Numpy-discussion] round(numpy.float64(0.0)) is a numpy.float64

2018-03-26 Thread Robert Kern
On Mon, Mar 26, 2018 at 6:28 PM, Nathaniel Smith wrote: > > On Mon, Mar 26, 2018 at 6:24 PM, Nathaniel Smith wrote: > > Even knowing that, it's still confusing that round(np.float64(0.0)) > > isn't the same as round(0.0). The reason is a Python 2 / Python 3 > > thing: in Python 2, round returns a

Re: [Numpy-discussion] round(numpy.float64(0.0)) is a numpy.float64

2018-03-26 Thread Nathaniel Smith
On Mon, Mar 26, 2018 at 6:24 PM, Nathaniel Smith wrote: > Even knowing that, it's still confusing that round(np.float64(0.0)) > isn't the same as round(0.0). The reason is a Python 2 / Python 3 > thing: in Python 2, round returns a float, while on Python 3, it > returns an integer – but numpy stil

Re: [Numpy-discussion] round(numpy.float64(0.0)) is a numpy.float64

2018-03-26 Thread Nathaniel Smith
Even knowing that, it's still confusing that round(np.float64(0.0)) isn't the same as round(0.0). The reason is a Python 2 / Python 3 thing: in Python 2, round returns a float, while on Python 3, it returns an integer – but numpy still uses the python 2 behavior everywhere. I'm not sure if it's po

Re: [Numpy-discussion] round(numpy.float64(0.0)) is a numpy.float64

2018-03-22 Thread Nathan Goldbaum
numpy.float is an alias to the python float builtin. https://github.com/numpy/numpy/issues/3998 On Thu, Mar 22, 2018 at 2:26 PM Olivier wrote: > Hello, > > > Is it normal, expected and desired that : > > > round(numpy.float64(0.0)) is a numpy.float64 > > > while > > round(numpy.flo

[Numpy-discussion] round(numpy.float64(0.0)) is a numpy.float64

2018-03-22 Thread Olivier
Hello, Is it normal, expected and desired that : round(numpy.float64(0.0)) is a numpy.float64 while round(numpy.float(0.0)) is an integer? I find it disturbing and misleading. What do you think? Has it already been discussed somewhere else? Best regards, Olivier _