Re: [Numpy-discussion] Indexing with callables (was: Yorick-like functionality)

2009-05-18 Thread josef . pktd
On Mon, May 18, 2009 at 6:22 PM, Robert Kern wrote: > On Mon, May 18, 2009 at 13:23, Pauli Virtanen wrote: >> Mon, 18 May 2009 09:21:39 -0700, David J Strozzi wrote: >> [clip] >>> I also like pointing out that Yorick was a fast, free environment >>> developed by ~1990, when matlab/IDL were probab

Re: [Numpy-discussion] Indexing with callables (was: Yorick-like functionality)

2009-05-18 Thread Robert Kern
On Mon, May 18, 2009 at 13:23, Pauli Virtanen wrote: > Mon, 18 May 2009 09:21:39 -0700, David J Strozzi wrote: > [clip] >> I also like pointing out that Yorick was a fast, free environment >> developed by ~1990, when matlab/IDL were probably the only comparable >> games in town, but very few peopl

Re: [Numpy-discussion] Indexing with callables (was: Yorick-like functionality)

2009-05-18 Thread Pauli Virtanen
Mon, 18 May 2009 09:21:39 -0700, David J Strozzi wrote: [clip] > I also like pointing out that Yorick was a fast, free environment > developed by ~1990, when matlab/IDL were probably the only comparable > games in town, but very few people ever used it. I think this is a case > study in the triump

Re: [Numpy-discussion] Indexing with callables (was: Yorick-like functionality)

2009-05-18 Thread David J Strozzi
> >The actual list of Yorick functions relevant here appears to be here: > > http:// yorick.sourceforge.net/manual/yorick_46.php#SEC46 > http:// yorick.sourceforge.net/manual/yorick_47.php#SEC47 > >I must say that I don't see many functions missing in Numpy... > >David (Strozzi): are th

Re: [Numpy-discussion] Overlap arrays with "transparency"

2009-05-18 Thread josef . pktd
On Mon, May 18, 2009 at 11:38 AM, Michael S. Gilbert wrote: > On Mon, 18 May 2009 05:37:09 -0700 (PDT), Cristi Constantin wrote: >> Good day. >> I am working on this algorithm for a few weeks now, so i tried almost >> everything... >> I want to overlap / overwrite 2 matrices, but completely ignor

Re: [Numpy-discussion] linear algebra help

2009-05-18 Thread Charles R Harris
On Mon, May 18, 2009 at 9:35 AM, wrote: > On Mon, May 18, 2009 at 10:55 AM, Charles R Harris > wrote: > > > > > > 2009/5/18 Stéfan van der Walt > >> > >> 2009/5/18 Sebastian Walter : > >> > B = numpy.dot(A.T, A) > >> > >> This multiplication should be avoided whenever possible -- you are > >> e

Re: [Numpy-discussion] Overlap arrays with "transparency"

2009-05-18 Thread Michael S. Gilbert
On Mon, 18 May 2009 05:37:09 -0700 (PDT), Cristi Constantin wrote: > Good day. > I am working on this algorithm for a few weeks now, so i tried almost > everything... > I want to overlap / overwrite 2 matrices, but completely ignore some values > (in this case ignore 0) > Let me explain: > > a =

Re: [Numpy-discussion] linear algebra help

2009-05-18 Thread josef . pktd
On Mon, May 18, 2009 at 10:55 AM, Charles R Harris wrote: > > > 2009/5/18 Stéfan van der Walt >> >> 2009/5/18 Sebastian Walter : >> > B = numpy.dot(A.T, A) >> >> This multiplication should be avoided whenever possible -- you are >> effectively squaring your condition number. > > Although the cond

Re: [Numpy-discussion] linear algebra help

2009-05-18 Thread Charles R Harris
2009/5/18 Stéfan van der Walt > 2009/5/18 Sebastian Walter : > > B = numpy.dot(A.T, A) > > This multiplication should be avoided whenever possible -- you are > effectively squaring your condition number. > Although the condition number doesn't mean much unless the columns are normalized. Having

[Numpy-discussion] SciPy 2009 Call for Papers

2009-05-18 Thread Jarrod Millman
== SciPy 2009 Call for Papers == SciPy 2009, the 8th Python in Science conference, will be held from August 18-23, 2009 at Caltech in Pasadena, CA, USA. Each year SciPy attracts leading figures in research and scientific software development with Py

Re: [Numpy-discussion] Problem with correlate

2009-05-18 Thread josef . pktd
2009/5/18 Stéfan van der Walt : > 2009/5/18 rob steed : >> This works fine. However, if the arrays have different lengths, we get a >> problem. >> > y2=N.array([0,0,0,1]) > N.correlate(x,y2,'full') > > This looks like a bug to me. > > In [54]: N.correlate([1, 0, 0, 0], [0, 0, 0, 1],'full')

[Numpy-discussion] Overlap arrays with "transparency"

2009-05-18 Thread Cristi Constantin
Good day. I am working on this algorithm for a few weeks now, so i tried almost everything... I want to overlap / overwrite 2 matrices, but completely ignore some values (in this case ignore 0) Let me explain: a = [ [1, 2, 3, 4, 5], [9,7], [0,0,0,0,0], [5,5,5] ] b = [ [0,0,9,9], [1,1,1,1], [2,2

Re: [Numpy-discussion] Problem with correlate

2009-05-18 Thread Stéfan van der Walt
2009/5/18 rob steed : > This works fine. However, if the arrays have different lengths, we get a > problem. > y2=N.array([0,0,0,1]) N.correlate(x,y2,'full') This looks like a bug to me. In [54]: N.correlate([1, 0, 0, 0], [0, 0, 0, 1],'full') Out[54]: array([1, 0, 0, 0, 0, 0, 0]) In [5

[Numpy-discussion] Problem with correlate

2009-05-18 Thread rob steed
Hi all, I have been using numpy.correlate and was finding something weird. I now think that there might be a bug. Correlations should be order dependent eg. correlate(x,y) != correlate(y,x) in general (whereas convolutions are symmetric) >>> import numpy as N >>> x = N.array([1,0,0]) >>> y =

Re: [Numpy-discussion] linear algebra help

2009-05-18 Thread Sebastian Walter
2009/5/18 Stéfan van der Walt : > 2009/5/18 Sebastian Walter : >> B = numpy.dot(A.T, A) > > This multiplication should be avoided whenever possible -- you are > effectively squaring your condition number. Indeed. > > In the case where you have more rows than columns, use least squares. > For squar

Re: [Numpy-discussion] linear algebra help

2009-05-18 Thread Stéfan van der Walt
2009/5/18 Sebastian Walter : > B = numpy.dot(A.T, A) This multiplication should be avoided whenever possible -- you are effectively squaring your condition number. In the case where you have more rows than columns, use least squares. For square matrices use solve. For large sparse matrices, use

Re: [Numpy-discussion] linear algebra help

2009-05-18 Thread Sebastian Walter
Alternatively, to solve A x = b you could do import numpy import numpy.linalg B = numpy.dot(A.T, A) c = numpy.dot(A.T, b) x = numpy.linalg(B,c) This is not the most efficient way to do it but at least you know exactly what's going on in your code. On Sun, May 17, 2009 at 7:21 PM, wrote: > O