Re: [Numpy-discussion] [SciPy-user] NumPy in Teaching

2007-03-01 Thread Alan G Isaac
On Tue, 27 Feb 2007, Steven H. Rogers apparently wrote: I'm doing an informal survey on the use of Array Programming Languages for teaching. If you're using NumPy in this manner I'd like to hear from you. What subject was/is taught, academic level, results, lessons learned, etc. I'm

[Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Mark P. Miller
I've been using Numpy arrays for some work recently. Just for fun, I compared some representative code using Numpy arrays and an object comprised of nested lists to represent my arrays. To my surprise, the array of nested lists outperformed Numpy in this particular application (in my actual

Re: [Numpy-discussion] NumPy in Teaching

2007-03-01 Thread Perry Greenfield
On Feb 28, 2007, at 7:32 PM, Joe Harrington wrote: Hi Steve, I have taught Astronomical Data Analysis twice at Cornell using IDL, and I will be teaching it next Fall at UCF using NumPy. Though I've been active here in the recent past, I'm actually not a regular NumPy user myself yet (I

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Perry Greenfield
On Mar 1, 2007, at 11:03 AM, Mark P. Miller wrote: I've been using Numpy arrays for some work recently. Just for fun, I compared some representative code using Numpy arrays and an object comprised of nested lists to represent my arrays. To my surprise, the array of nested lists

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Mark P. Miller
Interesting... I also tried the following and got similar results (using a 1,000 x 1,000 arrays). The time required to initialize the nested list array was much higher (but nonetheless small in the context of the overall time that my programs will run). But array element access is always

[Numpy-discussion] [ANN] PyTables 2.0 alpha2

2007-03-01 Thread Ivan Vilata i Balaguer
Hi all, I'm posting this message to announce the availability of the *second alpha release of PyTables 2.0*, the new and shiny major version of PyTables. This release settles the file format used in this major version, removing the need to use pickled objects in order to store system attributes,

Re: [Numpy-discussion] Buffer PEP in NumPy SVN

2007-03-01 Thread Travis Oliphant
Steven H. Rogers wrote: Travis Oliphant wrote: I just wanted to point people to the online version of the PEP. I'm still looking for comments and suggestions. The current version is here: http://projects.scipy.org/scipy/numpy/browser/trunk/numpy/doc/pep_buffer.txt -Travis Hi

[Numpy-discussion] mac binary distributions

2007-03-01 Thread Steven Bird
Hi -- the last dmg distribution was for numpy version 0.9.6. Is there any chance of having dmg distributions posted for the current version please? ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Travis Oliphant
Mark P. Miller wrote: I've been using Numpy arrays for some work recently. Just for fun, I compared some representative code using Numpy arrays and an object comprised of nested lists to represent my arrays. To my surprise, the array of nested lists outperformed Numpy in this particular

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Charles R Harris
On 3/1/07, Mark P. Miller [EMAIL PROTECTED] wrote: I've been using Numpy arrays for some work recently. Just for fun, I compared some representative code using Numpy arrays and an object comprised of nested lists to represent my arrays. To my surprise, the array of nested lists outperformed

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Mark P. Miller
##imports import numpy as NP from numpy.random import randint #numpy array code array1 = NP.zeros((50,50), int) def random1(): c = array1(randint(10), randint(10)) Is this a bug? You can't call an array. Did you mean, array1[randint(10), randint(10)]? Good catch...I

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Mark P. Miller
Sorry to pester, but is this the intended behavior of itemset? array1=numpy.zeros((10,10),int) array1 array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0,

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Francesc Altet
El dj 01 de 03 del 2007 a les 12:03 -0700, en/na Mark P. Miller va escriure: Sorry to pester, but is this the intended behavior of itemset? array1=numpy.zeros((10,10),int) array1 array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0,

Re: [Numpy-discussion] mac binary distributions

2007-03-01 Thread Christopher Barker
There are binaries of 1.0.1 here: http://pythonmac.org/packages/py24-fat/index.html and here: http://pythonmac.org/packages/py25-fat/index.html -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Mark P. Miller
try with array1.itemset((5,5),9) Yep...tried that. But I don't get it! import numpy array1 = numpy.zeros((10,10),int) array1 array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Francesc Altet
El dj 01 de 03 del 2007 a les 12:47 -0700, en/na Mark P. Miller va escriure: try with array1.itemset((5,5),9) Yep...tried that. But I don't get it! import numpy array1 = numpy.zeros((10,10),int) array1 array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0,

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Mark P. Miller
Ops, this seems a bug with your numpy version: In [46]:array1 = numpy.zeros((10,10),int) In [47]:array1.itemset((5,5),9) In [48]:array1 Out[48]: array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0,

[Numpy-discussion] In-place fancy selection

2007-03-01 Thread Francesc Altet
Hi, I don't think there is a solution for this, but perhaps anybody may offer some idea. Given: In [79]:a=numpy.arange(9,-1,-1) In [80]:b=numpy.arange(10) In [81]:numpy.random.shuffle(b) In [82]:b Out[82]:array([2, 6, 3, 5, 4, 9, 0, 8, 7, 1]) In [83]:a=a[b] In [84]:a Out[84]:array([7, 3, 6, 4,

Re: [Numpy-discussion] In-place fancy selection

2007-03-01 Thread Charles R Harris
On 3/1/07, Francesc Altet [EMAIL PROTECTED] wrote: Hi, I don't think there is a solution for this, but perhaps anybody may offer some idea. Given: In [79]:a=numpy.arange(9,-1,-1) In [80]:b=numpy.arange(10) In [81]:numpy.random.shuffle(b) In [82]:b Out[82]:array([2, 6, 3, 5, 4, 9, 0, 8, 7, 1])

Re: [Numpy-discussion] In-place fancy selection

2007-03-01 Thread Charles R Harris
On 3/1/07, Charles R Harris [EMAIL PROTECTED] wrote: On 3/1/07, Francesc Altet [EMAIL PROTECTED] wrote: Hi, I don't think there is a solution for this, but perhaps anybody may offer some idea. Given: In [79]:a=numpy.arange(9,-1,-1) In [80]:b=numpy.arange(10) In

Re: [Numpy-discussion] In-place fancy selection

2007-03-01 Thread Charles R Harris
On 3/1/07, Francesc Altet [EMAIL PROTECTED] wrote: Hi, I don't think there is a solution for this, but perhaps anybody may offer some idea. Given: In [79]:a=numpy.arange(9,-1,-1) In [80]:b=numpy.arange(10) In [81]:numpy.random.shuffle(b) In [82]:b Out[82]:array([2, 6, 3, 5, 4, 9, 0, 8, 7, 1])

Re: [Numpy-discussion] In-place fancy selection

2007-03-01 Thread Francesc Altet
El dj 01 de 03 del 2007 a les 13:26 -0700, en/na Charles R Harris va escriure: On 3/1/07, Francesc Altet [EMAIL PROTECTED] wrote: Hi, I don't think there is a solution for this, but perhaps anybody may offer some idea. Given: In

Re: [Numpy-discussion] In-place fancy selection

2007-03-01 Thread Charles R Harris
On 3/1/07, Francesc Altet [EMAIL PROTECTED] wrote: El dj 01 de 03 del 2007 a les 13:26 -0700, en/na Charles R Harris va escriure: On 3/1/07, Francesc Altet [EMAIL PROTECTED] wrote: Hi, I don't think there is a solution for this, but perhaps anybody may

Re: [Numpy-discussion] In-place fancy selection

2007-03-01 Thread Anne Archibald
On 01/03/07, Francesc Altet [EMAIL PROTECTED] wrote: Hi, I don't think there is a solution for this, but perhaps anybody may offer some idea. Given: In [79]:a=numpy.arange(9,-1,-1) In [80]:b=numpy.arange(10) In [81]:numpy.random.shuffle(b) In [82]:b Out[82]:array([2, 6, 3, 5, 4, 9, 0, 8, 7,

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

2007-03-01 Thread David M. Cooke
On Mar 1, 2007, at 13:33 , Rudolf Sykora wrote: Hello, since noone has reacted to my last e-mail yet (for several days), I feel the need to ask again (since I still do not know a good answer). Please help me. Hello everybody, I wonder how I could most easily accomplish the following:

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Christopher Barker
Francesc Altet wrote: Ops, this seems a bug with your numpy version: yup, it's a bug here too: numpy.__version__ '1.0.1' this is the dmg for python2.5 on pythonmac.org/packages -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Travis Oliphant
Mark P. Miller wrote: Ops, this seems a bug with your numpy version: In [46]:array1 = numpy.zeros((10,10),int) In [47]:array1.itemset((5,5),9) In [48]:array1 Out[48]: array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0,

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Robert Kern
Mark P. Miller wrote: Now however, I'm seeing perhaps a more serious problem: The test program that I'm working with went from taking ~80 seconds to run to taking over 10 minutes to run. I've rolled back to my old numpy version and confirmed that the old version was much faster. I also

[Numpy-discussion] Scalar coercion

2007-03-01 Thread Travis Oliphant
A ticket was posted that emphasizes that the current behavior of NumPy with regards to scalar coercion is different than numarray's behavior. If we were pre 1.0, I would probably change the behavior to be in-line with numarray. But, now I think it needs some discussion because we are

Re: [Numpy-discussion] [SciPy-user] NumPy in Teaching

2007-03-01 Thread Steven H. Rogers
Alan G Isaac wrote: On Tue, 27 Feb 2007, Steven H. Rogers apparently wrote: I'm doing an informal survey on the use of Array Programming Languages for teaching. If you're using NumPy in this manner I'd like to hear from you. What subject was/is taught, academic level, results,

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Charles R Harris
On 3/1/07, Mark P. Miller [EMAIL PROTECTED] wrote: OK...here goes. This code is going to look goofy, so please bear in mind that it is only an abstraction of what my real code does (which happens to provide interesting and meaning insights!). I've attached saved versions of my interactive

Re: [Numpy-discussion] when and where to use numpy arrays vs nested lists

2007-03-01 Thread Robert Kern
Charles R Harris wrote: Looks like function call overhead has gone way up or the cost of returning a float vs an array has gone way up. The loop overhead is about .01 and not significant. So something is definitely wrong here. Time to go look in trac ;) It might have been when Travis put in