Re: [Numpy-discussion] Status of np.bincount

2012-05-03 Thread Robert Elsner
Am 03.05.2012 15:45, schrieb Robert Kern: > On Thu, May 3, 2012 at 2:24 PM, Robert Elsner wrote: >> Hello Everybody, >> >> is there any news on the status of np.bincount with respect to "big" >> numbers? It seems I have just been bitten by #225. Is there an

[Numpy-discussion] Status of np.bincount

2012-05-03 Thread Robert Elsner
Hello Everybody, is there any news on the status of np.bincount with respect to "big" numbers? It seems I have just been bitten by #225. Is there an efficient way around? I found the np.histogram function painfully slow. Below a simple script, that demonstrates bincount failing with a memory erro

[Numpy-discussion] C api doc shortcomings

2011-08-01 Thread Robert Elsner
Hey Everybody, I noticed that the c-api docs (2.0.dev-72ab385) lack a clear statement what the preferred entry point into the c-api is (from a users point of view). Normally I would expect a sentence or two stating that the api entry point is arrayobject.h (or whatever). Instead the docs ponder ab

Re: [Numpy-discussion] Optimizing recursive loop - updated example

2011-07-25 Thread Robert Elsner
5:10 PM, Robert Elsner wrote: > >> Boiled it down a bit more to only include code that actually takes time. >> First time around I found the other variant more instructive because it >> shows the discrepancy between the DCT and the loop but might be >> confusing. Thus h

Re: [Numpy-discussion] Optimizing recursive loop - updated example

2011-07-25 Thread Robert Elsner
Yes I did. Slicing and Cython do not mix too well. Using an explicit loop fixes the problem. In case anybody is interested the code is attached. Thanks for your help Robert On 25.07.2011 12:30, Robert Elsner wrote: > Thanks for the hint. I thought about Cython myself but I was unable to &g

Re: [Numpy-discussion] Optimizing recursive loop - updated example

2011-07-25 Thread Robert Elsner
> On Sun, 24 Jul 2011 18:10:14 -0500, Robert Elsner > wrote: > >> Boiled it down a bit more to only include code that actually takes time. >> First time around I found the other variant more instructive because it >> shows the discrepancy between the DCT and the loop b

Re: [Numpy-discussion] Optimizing recursive loop - updated example

2011-07-24 Thread Robert Elsner
first derivative from the coefficients of the Chebyshev polynomials. Cheers Robert On 25.07.2011 00:43, Robert Elsner wrote: > Hey Everybody, > > I am approximating the derivative of nonperiodic functions on [-1,1] > using Chebyshev polynomials. The implementation is straightforward

[Numpy-discussion] Optimizing recursive loop

2011-07-24 Thread Robert Elsner
Hey Everybody, I am approximating the derivative of nonperiodic functions on [-1,1] using Chebyshev polynomials. The implementation is straightforward and works well but is painfully slow. The routine wastes most of its time on a trivial operation (see comment in the code) Unfortunately the spectr

Re: [Numpy-discussion] Multiply along axis

2011-06-29 Thread Robert Elsner
solution you pointed out. Thanks On 29.06.2011 16:38, Skipper Seabold wrote: > On Wed, Jun 29, 2011 at 10:32 AM, Robert Elsner wrote: >> Hello everyone, >> >> I would like to solve the following problem (preferably without >> reshaping / flipping the array a). >> >&g

Re: [Numpy-discussion] Multiply along axis

2011-06-29 Thread Robert Elsner
Oh and I forgot to mention: I want to specify the axis so that it is possible to multiply x along an arbitrary axis of a (given that the lengths match). On 29.06.2011 16:32, Robert Elsner wrote: > Hello everyone, > > I would like to solve the following problem (preferably without &g

[Numpy-discussion] Multiply along axis

2011-06-29 Thread Robert Elsner
your help Robert Elsner ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-09 Thread Robert Elsner
I suspect the author meant that instead (or a simple minus in front of the delta). Just posting because I wondered the same this morning after looking at it (after the first misunderstanding). It looks much better to me than the cumsum approach with its hidden test for true using .astype(numpy.int)

Re: [Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-09 Thread Robert Elsner
Well happens. The problem description was not 100% clear thus I still think your line did solve the problem. A simple misunderstanding. So what do I learn from it?: Always look at the code, not the description :D Am Mittwoch, den 09.06.2010, 10:19 +0200 schrieb Francesc Alted: > A Wednesday 09 Jun

Re: [Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-09 Thread Robert Elsner
> Given a certain value delta, I would like to get a subset of x, named > y, > where (y[i+1] - y[i]) >= delta So in fact the problem is to find y such that (y[i(k)+n] - y[i(k)]) >= delta for n <= len(x) - 1 - i and i(0) = 0, i(k+1) = i(k) + n ? Well a loop or list comparison seems like a good

Re: [Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-09 Thread Robert Elsner
Hah beat you to it one minute ;) Am Mittwoch, den 09.06.2010, 10:08 +0200 schrieb Francesc Alted: > A Wednesday 09 June 2010 10:00:50 V. Armando Solé escrigué: > > Well, this seems to be quite close to what I need > > > > y = numpy.cumsum((x[1:]-x[:-1])/delta).astype(numpy.int) > > i1 = numpy.non

Re: [Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-09 Thread Robert Elsner
There might be an easier way to accomplish that y = x[(x[1:]-x[:-1]) >= delta] cheers Am Mittwoch, den 09.06.2010, 10:00 +0200 schrieb "V. Armando Solé": > Well, this seems to be quite close to what I need > > y = numpy.cumsum((x[1:]-x[:-1])/delta).astype(numpy.int) > i1 = numpy.nonzero(y[1:]