Re: [Numpy-discussion] [Newbie] Fast plotting

2009-01-07 Thread Franck Pommereau
> This probably will have no impact on your tests, but this looks like a > bug. You probably mean: > > recXY = numpy.rec.fromarrays((x, y), names='x, y') Sure! Thanks. > Could you post the code you use to generate you inputs (ie what is x?) My code is probably not usable by somebody else tha

Re: [Numpy-discussion] [Newbie] Fast plotting

2009-01-07 Thread John Hunter
On Wed, Jan 7, 2009 at 6:37 AM, Franck Pommereau wrote: > def f4 (x, y) : >"""Jean-Baptiste Rudant > >test 1 CPU times: 111.21s >test 2 CPU times: 13.48s > >As Jean-Baptiste noticed, this solution is not very efficient (but >works almost of-the-shelf). >""" >recXY = n

Re: [Numpy-discussion] [Newbie] Fast plotting

2009-01-07 Thread Franck Pommereau
Hi all, First, let me say that I'm impressed: this mailing list is probably the most reactive I've ever seen. I've asked my first question and got immediately more solutions than time to test them... Many thanks to all the answerers. Using the various proposals, I ran two performance tests: - te

Re: [Numpy-discussion] [Newbie] Fast plotting

2009-01-06 Thread Alan G Isaac
A Tuesday 06 January 2009, Franck Pommereau escrigué: > s = {} # sum of y values for each distinct x (as keys) > n = {} # number of summed values (same keys) > for x, y in zip(X, Y) : > s[x] = s.get(x, 0.0) + y > n[x] = n.get(x, 0) + 1 Maybe this is not so bad with a couple changes? from

Re: [Numpy-discussion] [Newbie] Fast plotting

2009-01-06 Thread Sebastian Stephan Berg
Hello, Just thinking. If the parameters are limited, you may be able to use the histogram feature? Doing one histogram with Y as weights, then one without weights and calculating the mean from this yourself should be pretty speedy I imagine. Other then that maybe sorting the whole thing and then d

Re: [Numpy-discussion] [Newbie] Fast plotting

2009-01-06 Thread Bruce Southey
Francesc Alted wrote: > A Tuesday 06 January 2009, Franck Pommereau escrigué: > >> Hi all, and happy new year! >> >> I'm new to NumPy and searching a way to compute from a set of points >> (x,y) the mean value of y values associated to each distinct x value. >> Each point corresponds to a measur

Re: [Numpy-discussion] [Newbie] Fast plotting

2009-01-06 Thread Francesc Alted
A Tuesday 06 January 2009, Franck Pommereau escrigué: > Hi all, and happy new year! > > I'm new to NumPy and searching a way to compute from a set of points > (x,y) the mean value of y values associated to each distinct x value. > Each point corresponds to a measure in a benchmark (x = parameter,

[Numpy-discussion] [Newbie] Fast plotting

2009-01-06 Thread Franck Pommereau
Hi all, and happy new year! I'm new to NumPy and searching a way to compute from a set of points (x,y) the mean value of y values associated to each distinct x value. Each point corresponds to a measure in a benchmark (x = parameter, y = computation time) and I'd like to plot the graph of mean co