Re: [Numpy-discussion] inconsistent mgrid results

2007-03-04 Thread Lars Friedrich
Hello Andrew, Hello all, like Andrew, I had some strange experience with mgrid. Adrew writes: Am Dienstag, den 27.02.2007, 19:43 -0600 schrieb Andrew Corrigan: > I'm confused about the following: > > >>> print mgrid[2.45:2.6:0.05, 0:5:1] > [[[ 2.45 2.45 2.45 2.45 2.45] > [ 2.5 2.5 2.5

Re: [Numpy-discussion] numpy.linalg.qr bug on 64-bit platforms

2007-03-04 Thread Steffen Loeck
Fernando Perez wrote: > I recently got a report of a bug triggered only on 64-bit hardware, > and on a machine (in case it's relevant) that runs python 2.5. This > is with current numpy SVN which I just rebuilt a moment ago to > triple-check: > > In [3]: a = numpy.array([[1.0,2],[3,4]]) > > In [4]

Re: [Numpy-discussion] NumPy in Teaching

2007-03-04 Thread Joe Harrington
I wrote: > Cornell courses (undergrad only): > http://physics.ucf.edu/~jh/ast/ast234-2003/ > http://physics.ucf.edu/~jh/ast/ast234-2004/ I should have written: Cornell courses (undergrad only): http://physics.ucf.edu/~jh/ast/astro234-2003/ http://physics.ucf.edu/~jh/ast/astro234-2004/ --jh--

Re: [Numpy-discussion] First Numerical Python code...comments?

2007-03-04 Thread Steven H. Rogers
Alan G Isaac wrote: >> Charles R Harris wrote: >>> that this is planned for python 3.0 but maybe not yet in >>> current versions of python. From a ppt presentation by >>> Guido: >>> dict.keys(), range(), zip() won't return lists >>> killing dict.iterkeys(), xrange(), itertools.izip() > > On

Re: [Numpy-discussion] First Numerical Python code...comments?

2007-03-04 Thread Tyler J Hayes
Thanks for all of your suggestions. It's weird, I *know* about the array methods mentioned as well as the indexing tricks (it's one of the first things you read about), and yet I still *think* in Fortran. I have to get out of that frame of mind. Well, perfect practice, makes perfect, so on to

Re: [Numpy-discussion] Recarray sort() slowness

2007-03-04 Thread Francesc Altet
El dg 04 de 03 del 2007 a les 08:54 -0700, en/na Charles R Harris va escriure: > > > On 3/4/07, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On 3/4/07, Francesc Altet <[EMAIL PROTECTED]> wrote: > Hi, > > I've finally

Re: [Numpy-discussion] First Numerical Python code...comments?

2007-03-04 Thread Alan G Isaac
> Charles R Harris wrote: >> that this is planned for python 3.0 but maybe not yet in >> current versions of python. From a ppt presentation by >> Guido: >> dict.keys(), range(), zip() won't return lists >> killing dict.iterkeys(), xrange(), itertools.izip() On Sun, 04 Mar 2007, "Steven H. R

Re: [Numpy-discussion] First Numerical Python code...comments?

2007-03-04 Thread Steven H. Rogers
Charles R Harris wrote: > > > On 3/4/07, *Alan G Isaac* <[EMAIL PROTECTED] > > wrote: > > On Sun, 4 Mar 2007, Charles R Harris apparently wrote: > > range is now iterable and I read > > somewhere that xrange is deprecated. > > There has been a rumor

Re: [Numpy-discussion] First Numerical Python code...comments?

2007-03-04 Thread Charles R Harris
On 3/4/07, Alan G Isaac <[EMAIL PROTECTED]> wrote: On Sun, 4 Mar 2007, Charles R Harris apparently wrote: > range is now iterable and I read > somewhere that xrange is deprecated. There has been a rumor that range will effectively become xrange in Python 300 http://www.python.org/doc/essays/ppt

Re: [Numpy-discussion] building an array using smaller arrays

2007-03-04 Thread Rudolf Sykora
Thank you for your reply very much indeed. :) I guessed it could somehow so..., though I thought it could be somwhat simpler (not saying that your solution is too complicated :)) Ruda On 01/03/07, David M. Cooke <[EMAIL PROTECTED]> wrote: On Mar 1, 2007, at 13:33 , Rudolf Sykora wrote: > Hello

Re: [Numpy-discussion] First Numerical Python code...comments?

2007-03-04 Thread Alan G Isaac
On Sun, 4 Mar 2007, Charles R Harris apparently wrote: > range is now iterable and I read > somewhere that xrange is deprecated. There has been a rumor that range will effectively become xrange in Python 300 http://www.python.org/doc/essays/ppt/accu2006/Py3kACCU.ppt but range has always been i

Re: [Numpy-discussion] First Numerical Python code...comments?

2007-03-04 Thread Charles R Harris
On 3/3/07, Francesc Altet <[EMAIL PROTECTED]> wrote: > # Fill in SK with proper values > for i in range(numel): Always try to use xrange(numel) instead of range(numel). range() will return you a python list, and for large values of numel these can take precious amounts of memory. On his part,

Re: [Numpy-discussion] Recarray sort() slowness

2007-03-04 Thread Charles R Harris
On 3/4/07, Charles R Harris <[EMAIL PROTECTED]> wrote: On 3/4/07, Francesc Altet <[EMAIL PROTECTED]> wrote: > > Hi, > > I've finally implemented Chuck's suggestion of sorting of a recarray of > two fields (the first being the actual array to be sorted and the other > being the array to be reor

Re: [Numpy-discussion] Recarray sort() slowness

2007-03-04 Thread Charles R Harris
On 3/4/07, Francesc Altet <[EMAIL PROTECTED]> wrote: Hi, I've finally implemented Chuck's suggestion of sorting of a recarray of two fields (the first being the actual array to be sorted and the other being the array to be reordered following the resulting order for the first one). Indeed, this

Re: [Numpy-discussion] First Numerical Python code...comments?

2007-03-04 Thread Torgil Svensson
# Fill in SK with proper values for i in range(numel): RL = xord[i+1] - xord[i] RK = tens/RL SK[i][0] = SK[i][0] + RK SK[i][1] = SK[i][1] - RK IP1 = i+1 SK[IP1][0] = SK[IP1][0] + RK To get advantage of numpy you'll need to calculate with arrays instead of individual numbers: RL=xord

[Numpy-discussion] Recarray sort() slowness

2007-03-04 Thread Francesc Altet
Hi, I've finally implemented Chuck's suggestion of sorting of a recarray of two fields (the first being the actual array to be sorted and the other being the array to be reordered following the resulting order for the first one). Indeed, this approach saves me an amount of memory equivalent to the

Re: [Numpy-discussion] Adding a delete flag to make_svn_version_py() in distutils

2007-03-04 Thread pearu
Hi, The patch looks ok to me. Pearu > Hi All, > > I've got a small patch which I thought I'd run past the list before > checking in. While working on the NIPY project > (http://neuroimaging.scipy.org/) we spend a lot of time working from a > local source install, rather than a version installed in

[Numpy-discussion] Adding a delete flag to make_svn_version_py() in distutils

2007-03-04 Thread Tim Leslie
Hi All, I've got a small patch which I thought I'd run past the list before checking in. While working on the NIPY project (http://neuroimaging.scipy.org/) we spend a lot of time working from a local source install, rather than a version installed in site-packages. The mechanism which lets you do