[Numpy-discussion] Representation of NumPy scalars

2022-09-08 Thread Sebastian Berg
TL;DR: NumPy scalars representation is e.g. `34.3` instead of `float32(34.3)`. So the representation is missing the type information. What are your thoughts on changing that? Hi all, I am thinking about the next steps for NEP 50 (The NEP wants to fix the NumPy promotion rules, especially wit

[Numpy-discussion] Re: Representation of NumPy scalars

2022-09-08 Thread Peter Cock
Hello Sebastian, I rarely use NumPy scalars directly, but the repr change could have impact in assorted downstream projects' documentation. For clarity, this idea would not alter how NumPy arrays print, would it - since they already include the type information? >>> np.array([34.3, 10.1, -0.5],

[Numpy-discussion] Re: Representation of NumPy scalars

2022-09-08 Thread Sebastian Berg
On Thu, 2022-09-08 at 10:53 +0100, Peter Cock wrote: > Hello Sebastian, > > I rarely use NumPy scalars directly, but the repr change could > have impact in assorted downstream projects' documentation. > > For clarity, this idea would not alter how NumPy arrays print, > would it - since they alrea

[Numpy-discussion] Re: Representation of NumPy scalars

2022-09-08 Thread Andrew Nelson
On Thu, 8 Sept 2022, 19:42 Sebastian Berg, wrote: > > TL;DR: NumPy scalars representation is e.g. `34.3` instead of > `float32(34.3)`. So the representation is missing the type > information. What are your thoughts on changing that? > From the Python documentation on repr: >From the Python

[Numpy-discussion] Re: Representation of NumPy scalars

2022-09-08 Thread Stephan Hoyer
On Thu, Sep 8, 2022 at 3:41 AM Stefano Miccoli wrote: > On 8 Sep 2022, at 11:39, numpy-discussion-requ...@python.org wrote: > > TL;DR: NumPy scalars representation is e.g. `34.3` instead of > `float32(34.3)`. So the representation is missing the type > information. What are your thoughts on ch

[Numpy-discussion] Re: Representation of NumPy scalars

2022-09-08 Thread Alexander Heger
+1 from me. That would be really helpful. On Fri, 9 Sept 2022 at 05:18, Stephan Hoyer wrote: > On Thu, Sep 8, 2022 at 3:41 AM Stefano Miccoli > wrote: > >> On 8 Sep 2022, at 11:39, numpy-discussion-requ...@python.org wrote: >> >> TL;DR: NumPy scalars representation is e.g. `34.3` instead of >

[Numpy-discussion] Re: Representation of NumPy scalars

2022-09-08 Thread Warren Weckesser
On 9/8/22, Andrew Nelson wrote: > On Thu, 8 Sept 2022, 19:42 Sebastian Berg, > wrote: > >> >> TL;DR: NumPy scalars representation is e.g. `34.3` instead of >> `float32(34.3)`. So the representation is missing the type >> information. What are your thoughts on changing that? I like the idea,

[Numpy-discussion] Ufuncs and dtypes: New possibilities in NumPy - video

2022-09-08 Thread Inessa Pawson
A video recording of Sebastian Berg’s presentation “Ufuncs and dtypes: New possibilities in NumPy” has been posted on the NumPy YouTube channel: https://youtu.be/u9qU6cy5JkE. On Tue, Sep 6, 2022 at 10:58 PM Inessa Pawson wrote: > The next NumPy Newcomers Hour will be held this Thursday, Septembe

[Numpy-discussion] Re: Representation of NumPy scalars

2022-09-08 Thread Matti Picus
On 9/9/22 04:15, Warren Weckesser wrote: ... To quote from https://docs.python.org/3/library/functions.html#repr: For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(); Sebastian, is this an explicit goal of the

[Numpy-discussion] Re: Representation of NumPy scalars

2022-09-08 Thread Stefan van der Walt
I am in favor of such a change. It will make what is returned more transparent to users (and reduce confusion for newcomers). With NEP50, we're already adopting a philosophy of explicit scalar usage anyway: no longer pretending or trying to make transparent that Python floats and NumPy floats