Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-22 Thread Michael Sorich
> > Unfortunately if the value is changed to masked, this is not updated > > in the parent array. This seems very inconsistent. I don't view masked > > values any different than any other value. > > Inconsistent, maybe, useful definitely: > Masking a view and getting the original masked accordingly

Re: [Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Robert
Robert Kern wrote: > Tim Hochberg wrote: >> Robert Kern wrote: > >>> One possibility is to check if the object is an ndarray (or subclass) and >>> use >>> .copy() if so; otherwise, use the current implementation and hope that you >>> didn't pass it a Numeric or numarray array (or some other view-

Re: [Numpy-discussion] Numpy without BLAS, LAPACK

2006-11-22 Thread David M. Cooke
On 22 Nov 2006 16:44:07 - [EMAIL PROTECTED] wrote: > (Reposting to numpy-discussion@scipy.org instead of the SourceForge list.) > > > It is my understanding that Numpy has "lite" versions of BLAS and LAPACK > that it will use if it cannot find system libraries. Is it possible to FORCE > it t

Re: [Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Robert Kern
Christopher Barker wrote: > Robert Kern wrote: >> I don't want to assume that the only two sequence types are lists and arrays. > > Does numpy.random.shuffle really have to work on any sequence? and > without making a copy? I'm not so sure -- having num* functions operate > on any sequence has b

Re: [Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Christopher Barker
Robert Kern wrote: > I don't want to assume that the only two sequence types are lists and arrays. Does numpy.random.shuffle really have to work on any sequence? and without making a copy? I'm not so sure -- having num* functions operate on any sequence has been a design goal of Numeric from the

Re: [Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Tim Hochberg
Robert Kern wrote: > Tim Hochberg wrote: > >> Robert Kern wrote: >> > > >>> One possibility is to check if the object is an ndarray (or subclass) and >>> use >>> .copy() if so; otherwise, use the current implementation and hope that you >>> didn't pass it a Numeric or numarray array (or

Re: [Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Robert Kern
Tim Hochberg wrote: > Robert Kern wrote: >> One possibility is to check if the object is an ndarray (or subclass) and use >> .copy() if so; otherwise, use the current implementation and hope that you >> didn't pass it a Numeric or numarray array (or some other view-based object). >> > I think I

Re: [Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Tim Hochberg
Robert Kern wrote: > Christopher Barker wrote: > >> Robert Kern wrote: >> [SNIP] >>> I copied the algorithm from Python's random >>> module. At the core of it is a set of swaps: >>> >>> x[i], x[j] = x[j], x[i] >>> >>> With the kind of sequences that the stdlib random module is expecting

Re: [Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Robert Kern
Christopher Barker wrote: > Robert Kern wrote: >> This is really a thinko on my part. > > What, exactly, is a thinko? Like a typo except that the fault lies with the brain, not the fingers. >> I copied the algorithm from Python's random >> module. At the core of it is a set of swaps: >> >> x

Re: [Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Christopher Barker
Robert Kern wrote: > This is really a thinko on my part. What, exactly, is a thinko? > I copied the algorithm from Python's random > module. At the core of it is a set of swaps: > > x[i], x[j] = x[j], x[i] > > With the kind of sequences that the stdlib random module is expecting, that > mak

[Numpy-discussion] Numpy without BLAS, LAPACK

2006-11-22 Thread vallis . 35530053
(Reposting to numpy-discussion@scipy.org instead of the SourceForge list.) It is my understanding that Numpy has "lite" versions of BLAS and LAPACK that it will use if it cannot find system libraries. Is it possible to FORCE it to use the lite versions rather than existing system libraries? (Whe

Re: [Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Robert Kern
Alan G Isaac wrote: rr=N.array(zip(range(20),range(20))) pid = N.random.permutation(rr.shape[0]) rr=rr[pid] rr > array([[ 9, 9], >[ 2, 2], >[ 3, 3], >[15, 15], >[ 4, 4], >[11, 11], >[18, 18], >[17, 17], >[ 5,

Re: [Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Alan G Isaac
On Wed, 22 Nov 2006, Robert apparently wrote: numpy.random.shuffle(rr) The docstring is incomplete. From the NumPy Book: shuffle (sequence) Randomly permute the items of any sequence. If sequence is an array, then it must be 1-d. >>> rr=N.array(zip(range(20),range(20))) >>> N.

[Numpy-discussion] approx. replacement for scipy.special.betainc ?

2006-11-22 Thread Robert
for the computation of a p_value I need the betainc function, which draws the big _cephes module into a (numpy-only) app - the only reason for this import. I need it just for the computation of a p-value like: p_value = scipy.special.betainc(0.5*nf, 0.5, nf/(nf+t_value*t_value)) Is there a simpl

[Numpy-discussion] numpy.random.shuffle

2006-11-22 Thread Robert
is this an error when shuffle doubles&looses items on a 2-d array? : >>> r=arange(20) >>> rr=ziparrays(r,r) #numpy.vstack(*args).transpose() >>> rr array([[ 0, 0], [ 1, 1], [ 2, 2], [ 3, 3], [ 4, 4], [ 5, 5], [ 6, 6], [ 7, 7], [ 8,

[Numpy-discussion] How to deal with NAN and co in C extension to numpy/scipy ?

2006-11-22 Thread David Cournapeau
Hi, I am about to release some code to compute LPC coefficients (Auto regressive modeling, using Levinson Durbin algorithm for autocorrelation matrix inversion), and I was wondering how to handle cases of divide by 0, or values really near 0. I understand this is a complex issue, and I

[Numpy-discussion] scipy Windows binary compatible recent numpy 1.0 ?

2006-11-22 Thread Robert
Since some months now the latest scipy (0.5.1) binary (for Windows) is not compatible with current numpy (1.0) - obviously because of a C-library mismatch. Does somebody have a compatible binary - or when is the next scipy (binary) planned? Robert _