Re: [Numpy-discussion] Histograms of extremely large data sets

2006-12-13 Thread Cameron Walsh
Hi all, Absolutely gorgeous, I confirm the 1.6x speed-up over the weave version, i.e. a 25x speed-up over the existing version. It would be good if the redefinition of the range function could be changed in the numpy modules, before it goes into subversion, to avoid the need for Rick's line lran

Re: [Numpy-discussion] Histograms of extremely large data sets

2006-12-13 Thread eric jones
Looks to me like Rick's version is simpler and faster.It looks like it offers a speed-up of about 1.6 on my machine over the weave version. I believe this is because the sorting approach results in quite a few less compares than the algorithm I used. Very cool. I vote that his version go int

Re: [Numpy-discussion] Histograms of extremely large data sets

2006-12-13 Thread Rick White
On Dec 12, 2006, at 10:27 PM, Cameron Walsh wrote: > I'm trying to generate histograms of extremely large datasets. I've > tried a few methods, listed below, all with their own shortcomings. > Mailing-list archive and google searches have not revealed any > solutions. The numpy.histogram functio

Re: [Numpy-discussion] Histograms of extremely large data sets

2006-12-13 Thread eric jones
Glad to here it worked for you. see ya, eric Cameron Walsh wrote: > Thanks very much, Eric. That line fixed it for me, although I'm still > not sure why it broke with the last line. > > Your weave_histogram works a charm and is around 16 times faster than > any of the other options I've tried.

Re: [Numpy-discussion] Histograms of extremely large data sets

2006-12-13 Thread Cameron Walsh
Thanks very much, Eric. That line fixed it for me, although I'm still not sure why it broke with the last line. Your weave_histogram works a charm and is around 16 times faster than any of the other options I've tried. On my laptop it took 30 seconds to generate a histogram from 500 million numb

Re: [Numpy-discussion] Histograms of extremely large data sets

2006-12-13 Thread eric jones
Hmmm. ? Not sure. ? Change that line to this instead which should work as well. code = array_converter.declaration_code(self, templatize, inline) Both work for me. eric Cameron Walsh wrote: > On 13/12/06, Cameron Walsh <[EMAIL PROTECTED]> wrote: > >> On 13/12/06, eric jones <[EMAI

[Numpy-discussion] linalg.lstsq for complex

2006-12-13 Thread Bill Baxter
Is this code from linalg.lstsq for the complex case correct? lapack_routine = lapack_lite.zgelsd lwork = 1 rwork = zeros((lwork,), real_t) work = zeros((lwork,),t) results = lapack_routine(m, n, n_rhs, a, m, bstar, ldb, s, rcond,

Re: [Numpy-discussion] Histograms of extremely large data sets

2006-12-13 Thread Cameron Walsh
On 13/12/06, Cameron Walsh <[EMAIL PROTECTED]> wrote: > On 13/12/06, eric jones <[EMAIL PROTECTED]> wrote 290 lines of > awesome code and a fantastic explanation: > > > Hey Cameron, > > > > I wrote a simple weave based histogram function that should work for > > your problem. It should work for an

Re: [Numpy-discussion] rollaxis

2006-12-13 Thread Pierre GM
> Generate a column-permutation tuple and use fancy indexing: Works like a charm, thanks a lot ! ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] rollaxis

2006-12-13 Thread Pierre GM
On Wednesday 13 December 2006 15:29, A. M. Archibald wrote: > Generate an axis-permutation tuple and use transpose: Ah OK. It took me a little while to get it running: instead of s=list(A.shape) in your example, one should read s=range(A.ndim) But it does the trick, thanks a lot! And now, dou

Re: [Numpy-discussion] fromfile and tofile access with a tempfile.TemporaryFile()

2006-12-13 Thread Tim Hirzel
Thanks for everyone's help and thoughts. I agree that this behavior is buggy. I submitted a bug report to the python project at sourceforge, with a link to this thread. Hopefully the report will be helpful. tim Charles R Harris wrote: > > > On 12/12/06, *Travis Oliphant* <[EMAIL PROTECTED]

Re: [Numpy-discussion] rollaxis

2006-12-13 Thread A. M. Archibald
On 13/12/06, Pierre GM <[EMAIL PROTECTED]> wrote: > All, > I have a ND array whose axes I want to reorganize, so that axis "i" is at the > end while the others stay in their relative position. What's the easiest ? Generate an axis-permutation tuple and use transpose: s = list(A.shape) s.remove(i)

[Numpy-discussion] rollaxis

2006-12-13 Thread Pierre GM
All, I have a ND array whose axes I want to reorganize, so that axis "i" is at the end while the others stay in their relative position. What's the easiest ? ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/l

[Numpy-discussion] .byteswap() and copy/view dilemma

2006-12-13 Thread Francesc Altet
Hi, I'm a bit confused about which cases the .byteswap() method in NumPy would return a copy or a view. From the docstrings: """ a.byteswap(False) -> View or copy. Swap the bytes in the array. Swap the bytes in the array. Return the byteswapped array. If the first argument is TRUE, byteswap in

Re: [Numpy-discussion] Histograms of extremely large data sets

2006-12-13 Thread Cameron Walsh
On 13/12/06, eric jones <[EMAIL PROTECTED]> wrote 290 lines of awesome code and a fantastic explanation: > Hey Cameron, > > I wrote a simple weave based histogram function that should work for > your problem. It should work for any array input data type. The needed > files (and a few tests and e