On 9/13/19 9:26 AM, Eric Moore wrote:
> See the notes section here.
> https://numpy.org/devdocs/reference/generated/numpy.around.html.
>
> This note was recently added in https://github.com/numpy/numpy/pull/14392
>
> Eric
Hmm, but this example with 16.055 shows the note still isn't quite right
On 7/4/19, Kexuan Sun wrote:
> Hi,
>
> I would like to request a code review. The random.permutation and
> random.shuffle functions now can only shuffle along the first axis of a
> multi-dimensional array. I propose to add an axis argument for the
> functions and allow them to shuffle along a give
In my opinion the problem is that numpy floats break the Liskov substitution
principle,
>>> pyfloat = 16.055
>>> npfloat = np.float64(pyfloat)
>>> isinstance(npfloat, float)
True
>>> round(pyfloat, 2)
16.05
>>> round(npfloat, 2)
16.06
Since numpy.float64 is a subclass of builtins.float I would e
On 13/09/2019 15:26, Eric Moore wrote:
See the notes section here.
https://numpy.org/devdocs/reference/generated/numpy.around.html.
This note was recently added in https://github.com/numpy/numpy/pull/14392
Thanks, it indeed explains the discrepancy.
_
See the notes section here.
https://numpy.org/devdocs/reference/generated/numpy.around.html.
This note was recently added in https://github.com/numpy/numpy/pull/14392
Eric
On Fri, Sep 13, 2019 at 9:20 AM Andras Deak wrote:
> On Fri, Sep 13, 2019 at 2:59 PM Philip Hodge wrote:
> >
> > On 9/13/
On Fri, Sep 13, 2019 at 2:59 PM Philip Hodge wrote:
>
> On 9/13/19 8:45 AM, Irvin Probst wrote:
> > On 13/09/2019 14:05, Philip Hodge wrote:
> >>
> >> Isn't that just for consistency with Python 3 round()? I agree that
> >> the discrepancy with np.set_printoptions is not necessarily expected,
> >
On 9/13/19 8:45 AM, Irvin Probst wrote:
On 13/09/2019 14:05, Philip Hodge wrote:
Isn't that just for consistency with Python 3 round()? I agree that
the discrepancy with np.set_printoptions is not necessarily expected,
except possibly for backwards compatibility.
I've just checked and n
On 13/09/2019 14:05, Philip Hodge wrote:
Isn't that just for consistency with Python 3 round()? I agree that
the discrepancy with np.set_printoptions is not necessarily expected,
except possibly for backwards compatibility.
I've just checked and np.set_printoptions behaves as python's ro
On 9/13/19 7:23 AM, Andras Deak wrote:
I just want to add that you can use literal 16.055 to reproduce this:
import numpy as np
np.set_printoptions(precision=2)
np.array([16.055]).round(2)
array([16.06])
np.array([16.055])
array([16.05])
I would think it has to do with "round to nearest eve
On Fri, Sep 13, 2019 at 12:58 PM Irvin Probst
wrote:
>
> Hi,
> Is it expected/documented that np.round and np.set_printoptions do not
> output the same result on screen ?
> I tumbled into this running this code:
>
> import numpy as np
> mes = np.array([
> [16.06, 16.13, 16.06, 16.00, 16.06, 1
Hi,
Is it expected/documented that np.round and np.set_printoptions do not
output the same result on screen ?
I tumbled into this running this code:
import numpy as np
mes = np.array([
[16.06, 16.13, 16.06, 16.00, 16.06, 16.00, 16.13, 16.00]
])
avg = np.mean(mes, axis=1)
print(np.round(avg
Hi,
Thanks - yes - I agree, an axis argument seems like a very sensible idea.
Cheers,
Matthew
On Fri, Sep 13, 2019 at 7:48 AM Juan Nunez-Iglesias wrote:
>
> I don’t understand why the proposal would be controversial in any way. It’s
> very natural to have `axis=` keyword arguments in NumPy, a
12 matches
Mail list logo