[Numpy-discussion] An alternative to vectorize that lets you access the array?

2020-07-12 Thread Ram Rachum
Hi everyone, Here's a problem I've been dealing with. I wonder whether NumPy has a tool that will help me, or whether this could be a useful feature request. In the upcoming EuroPython 20200, I'll do a talk about live-coding a music synthesizer. It's going to be a fun talk, I'll use the sounddevi

Re: [Numpy-discussion] An alternative to vectorize that lets you access the array?

2020-07-12 Thread Andras Deak
On Sun, Jul 12, 2020 at 3:02 PM Ram Rachum wrote: > > Hi everyone, > > Here's a problem I've been dealing with. I wonder whether NumPy has a tool > that will help me, or whether this could be a useful feature request. > > In the upcoming EuroPython 20200, I'll do a talk about live-coding a music

Re: [Numpy-discussion] An alternative to vectorize that lets you access the array?

2020-07-12 Thread Sebastian Berg
On Sun, 2020-07-12 at 16:00 +0300, Ram Rachum wrote: > Hi everyone, > > Here's a problem I've been dealing with. I wonder whether NumPy has a > tool > that will help me, or whether this could be a useful feature request. > > In the upcoming EuroPython 20200, I'll do a talk about live-coding a > m

Re: [Numpy-discussion] An alternative to vectorize that lets you access the array?

2020-07-12 Thread Ram Rachum
Thank you Sebastian and Andras for your detailed replies. Sebastian, your suggestion of adding `item.item()` solved my problem! Now the for loop is still slower than vectorize, but by a smaller factor, and that's fast enough for my demonstration. My problem is solved and I'm very happy! I also tr

Re: [Numpy-discussion] Numpy FFT normalization options issue (addition of new option)

2020-07-12 Thread Sebastian Berg
Just a heads-up. As I think the discussion seemed to settled on "backwards" (default, identical to None), "forward" and the existing "ortho". Thus "forward" and "backward" are now new valid values for the `norm` keyword argument to the fft functions in NumPy. (see https://github.com/numpy/numpy/