Re: [Numpy-discussion] Using scalar constructors to produce arrays

2020-04-19 Thread Sebastian Berg
On Sun, 2020-04-19 at 21:07 +0200, Ralf Gommers wrote: > On Sun, Apr 19, 2020 at 8:47 PM Joshua Wilson < > josh.craig.wil...@gmail.com> > wrote: > > > Over in the NumPy stubs there's an issue > > > > https://github.com/numpy/numpy-stubs/issues/41 > > > > which points out that you can in fact do

Re: [Numpy-discussion] Using scalar constructors to produce arrays

2020-04-19 Thread Ralf Gommers
On Sun, Apr 19, 2020 at 8:47 PM Joshua Wilson wrote: > Over in the NumPy stubs there's an issue > > https://github.com/numpy/numpy-stubs/issues/41 > > which points out that you can in fact do something like > > ``` > np.float32([1.0, 0.0, 0.0]) > ``` > > to construct an ndarray of float32. It see

[Numpy-discussion] Using scalar constructors to produce arrays

2020-04-19 Thread Joshua Wilson
Over in the NumPy stubs there's an issue https://github.com/numpy/numpy-stubs/issues/41 which points out that you can in fact do something like ``` np.float32([1.0, 0.0, 0.0]) ``` to construct an ndarray of float32. It seems to me that though you can do that, it is not a best practice, and one