[Numpy-discussion] Re: representation of valid float type range

2022-01-10 Thread Eric Moore
On Mon, Jan 10, 2022 at 7:15 AM Hameer Abbasi wrote: > Hello all. > > I believe that over the years there were multiple proposals to replace the > linspace formula start + n *(stop - start) / (npoints - 1) with a * start + > b * end with a, b linearly spaced between 0 and 1 with npoints. Concrete

Re: [Numpy-discussion] NumPy Feature Request: Function to wrap angles to range [ 0, 2*pi] or [ -pi, pi ]

2020-11-24 Thread Eric Moore
On Tue, Nov 24, 2020 at 6:38 AM Daniele Nicolodi wrote: > On 24/11/2020 10:25, Thomas wrote: > > Like Nathaniel said, it would not improve much when compared to the > > modulo operator. > > > > It could handle the edge cases better, but really the biggest benefit > > would be that it is more conv

Re: [Numpy-discussion] Type declaration to include all valid numerical NumPy types for Cython

2020-08-09 Thread Eric Moore
If that is really all you need, then the version in python is: def convert_one(a): """ Converts input with arbitrary layout and dtype to a blas/lapack compatible dtype with either C or F order. Acceptable objects are passed through without making copies. """ a_arr = np.as

Re: [Numpy-discussion] Handle type convertion in C API

2020-03-11 Thread Eric Moore
actical to have 4 > variant of the function, but in case of 6-8 parameters it's becoming > more difficult. > > Best regards > > Le mardi 10 mars 2020 à 13:13 -0400, Eric Moore a écrit : > > Hi Benoit, > > > > Since you have a function that takes two scalars to one scal

Re: [Numpy-discussion] Handle type convertion in C API

2020-03-10 Thread Eric Moore
Hi Benoit, Since you have a function that takes two scalars to one scalar, it sounds to me as though you would be best off creating a ufunc. This will then handle the conversion to and looping over the arrays, etc for you. The documentation is available here: https://numpy.org/doc/1.18/user/c-in

Re: [Numpy-discussion] round / set_printoptions discrepancy

2019-09-13 Thread Eric Moore
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/

Re: [Numpy-discussion] asanyarray vs. asarray

2018-10-30 Thread Eric Moore
On Tue, Oct 30, 2018 at 12:49 AM Eric Wieser wrote: > The latter - changing the behavior of multiplication breaks the principle. > > But this is not the main reason for deprecating matrix - almost all of the > problems I’ve seen have been caused by the way that matrices behave when > sliced. The

Re: [Numpy-discussion] Using the C-API iterator with object arrays

2018-02-12 Thread Eric Moore
On Mon, Feb 12, 2018 at 6:13 AM, Eugen Wintersberger < eugen.wintersber...@gmail.com> wrote: > Hi there, > I have a question concerning the numpy iterator C-API. I want to create a > numpy > string array using NPY_OBJECT as a datatype for creating the array (the > reason I am going for this > appr