[Numpy-discussion] [ANN] garnumpy 0.1, a gar system to build a self contained scipy environment (unix only)

2007-03-01 Thread David Cournapeau
Hi, I am not sure whether this is really useful to other, but anyway: I release the first version of garnumpy, a system derived from Nick Moffit's gar system, to build a set of packages from sources. The idea is to build numpy + scipy automatically with its dependencies, like a complete

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

2007-03-01 Thread David Cournapeau
Andrew Straw wrote: > Perry Greenfield wrote: >> 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 th

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

2007-03-01 Thread Charles R Harris
On 3/1/07, Robert Kern <[EMAIL PROTECTED]> wrote: 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

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

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 py

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, res

Re: [Numpy-discussion] Scalar coercion

2007-03-01 Thread Charles R Harris
On 3/1/07, Travis Oliphant <[EMAIL PROTECTED]> wrote: 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 t

Re: [Numpy-discussion] Scalar coercion

2007-03-01 Thread Travis Oliphant
Robert Kern wrote: >Travis Oliphant wrote: > > > >>So the question is: Do we keep the current behavior or change the >>behavior to be more consistent with numarray. My current preference is >>to change the behavior so it is more consistent with numarray (even >>though it's actually not goin

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

2007-03-01 Thread Mark P. Miller
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 python sessions that document the phenomenon. Again,

Re: [Numpy-discussion] how to combine (stack) two masked arrays?

2007-03-01 Thread Jim Vickroy
Thanks for the quick response! Please see my in-line comments below. Pierre GM wrote: Hello, The simplest is: rescaled[rescaled.mask]=clipped_mask[rescaled.mask] But for this particular kind of operation, I don't think that you need masked array at all: this could do the trick rescaled = c

Re: [Numpy-discussion] Scalar coercion

2007-03-01 Thread Robert Kern
Travis Oliphant wrote: > So the question is: Do we keep the current behavior or change the > behavior to be more consistent with numarray. My current preference is > to change the behavior so it is more consistent with numarray (even > though it's actually not going to be trivial to do that).

[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 changi

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: One more note (this perhaps may need a separate topic): I've been using the Enthought python edition that contains python 2.4.3 and numpy 0.9.9.2706. After Robert Kern pointed out that I should try numpy 1.0.1, I went ahead and installed it

Re: [Numpy-discussion] how to combine (stack) two masked arrays?

2007-03-01 Thread Pierre GM
Hello, The simplest is: rescaled[rescaled.mask]=clipped_mask[rescaled.mask] But for this particular kind of operation, I don't think that you need masked array at all: this could do the trick >>>rescaled = clipped.copy() >>>inside = numpy.logical_and(clipped>=123, clipped<=354) >>>outside = numpy

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 a

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

2007-03-01 Thread Mark P. Miller
One more note (this perhaps may need a separate topic): I've been using the Enthought python edition that contains python 2.4.3 and numpy 0.9.9.2706. After Robert Kern pointed out that I should try numpy 1.0.1, I went ahead and installed it (downloaded a few hours ago: "numpy-1.0.1.win32-py2.4

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,

[Numpy-discussion] how to combine (stack) two masked arrays?

2007-03-01 Thread Jim Vickroy
Hello all, I am stuck in my attempts to use masked arrays to combine the contents of two arrays (please see the masked-arrays.py attachment) such that missing values in one array are provided by the second array. There are no ambiguities in the combination operation because each of the two a

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/OR&R(206) 526-6

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] 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, 1

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

2007-03-01 Thread Francesc Altet
El dj 01 de 03 del 2007 a les 13:40 -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: > >

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 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: > >

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 [81]:numpy

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]

[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, 5,

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,

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], >

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

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/OR&R(206) 526-6959 voice 7600 Sand Point Way N

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

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,

[Numpy-discussion] building an array using smaller arrays

2007-03-01 Thread Rudolf Sykora
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: Say I have sth like: a = array( [1, 2] ) and I want to us

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

2007-03-01 Thread Robert Kern
Mark P. Miller wrote: > Travis: Can you clarify this for me. The book doesn't have much detail > here and seems to differ from your notation (which gives me errors). > numpy 0.9.9.2706 This is the problem. You will need to upgrade to 1.0.1. -- Robert Kern "I have come to believe that the wh

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

2007-03-01 Thread Mark P. Miller
Travis: Can you clarify this for me. The book doesn't have much detail here and seems to differ from your notation (which gives me errors). >> Getting single indices like this is a bit slower for NumPy then for >> lists because of all the possibilities that must be distinguished for >> array

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)]?

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 outperforme

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 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

[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 http://projects.scipy.org/mailman/listinfo/nu

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

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

2007-03-01 Thread Andrew Straw
Perry Greenfield wrote: > 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 no

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 fas

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 outper

[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] 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

[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] [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.

Re: [Numpy-discussion] NumPy in Teaching

2007-03-01 Thread Steven H. Rogers
Thanks Mike: Michael Williams wrote: > On Tue, Feb 27, 2007 at 09:05:58PM -0700, Steven H. Rogers 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

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

2007-03-01 Thread Steven H. Rogers
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 Travis: I'd like to help,

Re: [Numpy-discussion] NumPy in Teaching

2007-03-01 Thread Michael Williams
On Tue, Feb 27, 2007 at 09:05:58PM -0700, Steven H. Rogers 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, e

Re: [Numpy-discussion] PyCon 2007

2007-03-01 Thread Francesc Altet
El dc 28 de 02 del 2007 a les 14:03 -0700, en/na Travis Oliphant va escriure: > I took the opportunity to go to PyCon this year and met several people > there. I had a really good time although I would have liked to stay > longer. If you want to see the slides for my talk they are here: > > h