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

2019-07-23 Thread Ram Rachum
Hi everyone! Total Numpy newbie here. I'd like to create an array with a million numbers, that has a sine wave with exponential decay on the amplitude. In other words, I want the value of each cell n to be sin(n) * 2 ** (-n * factor). What would be the most efficient way to do that? Someone sug

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

2019-07-23 Thread Hameer Abbasi
Hi Ram, No, NumPy doesn’t have a way. And it newer versions, it probably won’t create two arrays if all the dtypes match, it’ll do some magic to re use the existing ones, although it will use multiple loops instead of just one. You might want to look into NumExpr or Numba if you want an efficie

[Numpy-discussion] NumPy Community Meeting Wednesday, July 24

2019-07-23 Thread Sebastian Berg
Hi all, There will be a NumPy Community meeting Wednesday July 24 at 11 am Pacific Time. Everyone is invited to join in and edit the work-in- progress meeting topics and notes: https://hackmd.io/76o-IxCjQX2mOXO_wwkcpg Best wishes Sebastian signature.asc Description: This is a digitally signed

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

2019-07-23 Thread Stanley Seibert
(Full disclosure: I work on Numba...) Just to note, the NumPy implementation will allocate (and free) more than 2 arrays to compute that expression. It has to allocate the result array for each operation as Python executes. That expression is equivalent to: s1 = newfactor * x s2 = np.exp(s1) s3

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

2019-07-23 Thread Sebastian Berg
On Tue, 2019-07-23 at 13:38 -0500, Stanley Seibert wrote: > (Full disclosure: I work on Numba...) > > Just to note, the NumPy implementation will allocate (and free) more > than 2 arrays to compute that expression. It has to allocate the > result array for each operation as Python executes. Tha

[Numpy-discussion] NEP 28 — A standard community policy for dropping support of old Python and NumPy versions

2019-07-23 Thread Thomas Caswell
Folks, This NEP is a proposing a standard policy for the community to determine when we age-out support for old versions of Python. This came out of in-person discussions at SciPy earlier in July and scattered discussion across github. This is being proposed by maintainers from Matplotlib, scikit