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

2020-07-13 Thread Ram Rachum
20 at 5:03 PM Sebastian Berg > wrote: > >> 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

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

2020-07-12 Thread Ram Rachum
03 PM Sebastian Berg wrote: > 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 re

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

2020-07-12 Thread Ram Rachum
on to `vectorize`? 2. Is there a more efficient way of writing the `for` loop I've written above? Or any other kind of solution to my problem? Thanks for your help, Ram Rachum. ___ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Creating a sine wave with exponential decay

2019-07-26 Thread Ram Rachum
focus on making good use of arrays, >>> > NumPy array functions, and array expressions in your code. If you >>> > have to write for loops (if there is no good way to do the operation >>> > with existing NumPy functions), I would reach for something like >>>

[Numpy-discussion] Creating a sine wave with exponential decay

2019-07-23 Thread Ram Rachum
meone suggested I do something like this: y = np.sin(x) * np.exp(newfactor * x) But this would create 2 arrays, wouldn't it? Isn't that wasteful? Does Numpy provide an efficient way of doing that without creating a redundant array? Thanks for your he