Re: [Numpy-discussion] F2PY clarification of "so" file

2007-03-05 Thread Robert Kern
Tyler Hayes wrote: > Hello All: > > Well, I recently managed to get some small FEM code to work using > NumPy and some .so modules I created from Fortran90 routines via f2py. > > Anyways, my Prof was impressed with f2py but had a simple question > that I'm afriad I didn't precisely know the answe

[Numpy-discussion] F2PY clarification of "so" file

2007-03-05 Thread Tyler Hayes
Hello All: Well, I recently managed to get some small FEM code to work using NumPy and some .so modules I created from Fortran90 routines via f2py. Anyways, my Prof was impressed with f2py but had a simple question that I'm afriad I didn't precisely know the answer to. The question is this: Is

Re: [Numpy-discussion] Matlab -> NumPy translation and indexing

2007-03-05 Thread David Cournapeau
David Koch wrote: > Hello, > > I am trying to translate some Matlab code to NumPy. I started reading > the NumPy book and, yeah it's a very long read :-/ One thing I am > completely confused about are the concpets of "basic" vs. "advanced" > indexing. Are there some good examples out there where

Re: [Numpy-discussion] Empty record arrays

2007-03-05 Thread Sameer DCosta
On 3/5/07, Christopher Barker <[EMAIL PROTECTED]> wrote: > empty() works too, but why would you want an empty array? I wanted to use rec.fromrecords so that the interface is consistent. For example, suppose I have a list comprehension that generates the variable "recs". Sometimes the list compreh

Re: [Numpy-discussion] Empty record arrays

2007-03-05 Thread Robert Kern
Christopher Barker wrote: > empty() works too, but why would you want an empty array? Consistently handling edge-case inputs to library functions. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpr

Re: [Numpy-discussion] Empty record arrays

2007-03-05 Thread Christopher Barker
empty() works too, but why would you want an empty array? >>> import numpy as N >>> dt = [("name", "S30"), ("age", "i2"), ("weight", "f4")] >>> a = N.empty((0,), dtype=dt) >>> a array([], dtype=[('name', '|S30'), ('age', '>i2'), ('weight', '>f4')]) -Chris Sameer DCosta wrote: > Hi, >

[Numpy-discussion] Empty record arrays

2007-03-05 Thread Sameer DCosta
Hi, I am trying to create record arrays using the numpy.rec.fromrecords. This function works just fine, however I am having a little trouble using it to create empty record arrays. If the array I start off with is empty and I have provided a dtype (or the names and the formats), then I expect rec.

Re: [Numpy-discussion] Matlab -> NumPy translation and indexing

2007-03-05 Thread David Koch
Thank you everybody for your replies. Completely off-topic: I just read your sig Christoper: Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R Do you work with tsunami early-warning systems? I once had to give a presentation at Uni about the type of buoy

Re: [Numpy-discussion] Matlab -> NumPy translation and indexing

2007-03-05 Thread Christopher Barker
David Koch wrote: > - Is it "pythonic" to initialize vectors to 2 dimensions so that > vec.shape == (len(vec), 1) instead of vec.shape == (len(vec),)? It depends what it means -- and this is not a question of Pythonic -- maybe Numpythonic? Numpy is an n-d array package -- NOT a matrix package (

Re: [Numpy-discussion] Matlab -> NumPy translation and indexing

2007-03-05 Thread Charles R Harris
On 3/5/07, David Koch <[EMAIL PROTECTED]> wrote: Hello, I am trying to translate some Matlab code to NumPy. I started reading the NumPy book and, yeah it's a very long read :-/ One thing I am completely confused about are the concpets of "basic" vs. "advanced" indexing. Are there some good exam

Re: [Numpy-discussion] Scalar coercion

2007-03-05 Thread Christopher Hanley
Hello Everyone, Another behavior we might consider changing for 1.0.2 that I believe is somewhat related in theme is the default type used in computations like the mean() method. This is best illustrated with the following example: sparty> python Python 2.5 (r25:51908, Sep 21 2006, 13:33:15) [

Re: [Numpy-discussion] Matlab -> NumPy translation and indexing

2007-03-05 Thread Alan G Isaac
On 3/5/2007 2:13 PM, David Koch wrote: > - Given a matrix R, is there an equvialent to the Matlab > operation R(:,j) = [] (which removes column j and > "shrinks" the matrix? >>> help(numpy.delete) Help on function delete in module numpy.lib.function_base: delete(arr, obj, axis=None) Retu

Re: [Numpy-discussion] Matlab -> NumPy translation and indexing

2007-03-05 Thread Sturla Molden
On 3/5/2007 2:13 PM, David Koch wrote: > - Am I correct in assuming that all arrays have to be initialized to > their final number of elements in NumPy (using empty/zero for instance)? You can also create an array from a Python list, data in a file, another array or a memory mapping. In these c

[Numpy-discussion] Matlab -> NumPy translation and indexing

2007-03-05 Thread David Koch
Hello, I am trying to translate some Matlab code to NumPy. I started reading the NumPy book and, yeah it's a very long read :-/ One thing I am completely confused about are the concpets of "basic" vs. "advanced" indexing. Are there some good examples out there where for the same piece of code - M

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

2007-03-05 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 > Adding some use cases to the rationale mi

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

2007-03-05 Thread Nils Wagner
Steffen Loeck wrote: > 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

[Numpy-discussion] new repository for free software and forum community started

2007-03-05 Thread Giorgio Luciano
Dear All I'm happy and proud to announce that a repository for free chemometric software (in particular Python oriented) has started. at www.chemometrics.it Some time ago I've sent an email to the ICS asking if anybody knows the esistence of a python repository for chemometrics, I had a positi

Re: [Numpy-discussion] numpy.dot and ACML

2007-03-05 Thread Yves Frederix
Hi, > I am also looking to verify the vendor-libs being used. > > What does numpy.__config__.show() tell you ? > In the case of the ACML compilation, I get: 0 [EMAIL PROTECTED] .../u0050015 $ python -c "import numpy; numpy.show_config()" atlas_threads_info: libraries = ['lapack', 'a