[Numpy-discussion] List of Lists in C

2009-01-26 Thread Hanni Ali
Hi, Quick question, I've been doing a fair bit of extension writing in C recently, but wondered how best to implement: l = [[]] * 5 to create a list of a given length containing the initialization variable desired. A loop seems the straight forward manner, but I would have thought there was a

Re: [Numpy-discussion] List of Lists in C

2009-01-26 Thread Matthieu Brucher
Hi, Don't remember that you are using the same list in each element of the outer list. If you don't want this, use [[] for i in range(5)]. I don't think there is another way in C either (or too complicated). Matthieu 2009/1/26 Hanni Ali hanni@gmail.com: Hi, Quick question, I've been

Re: [Numpy-discussion] List of Lists in C

2009-01-26 Thread Hanni Ali
Yes fair point, but when it's a empty list and new elements are replaced with a new list instance it's fine, especially as [[]]*10 is significantly faster than [[] for i in xrange(10)] as I was previously doing. In fact I think that's partly answered my question [[]]*x must create a list

Re: [Numpy-discussion] List of Lists in C

2009-01-26 Thread Matthieu Brucher
2009/1/26 Hanni Ali hanni@gmail.com: Yes fair point, but when it's a empty list and new elements are replaced with a new list instance it's fine, especially as [[]]*10 is significantly faster than [[] for i in xrange(10)] as I was previously doing. In this case, why do you put a

[Numpy-discussion] Array of matrices - Inverse and dot

2009-01-26 Thread Jean-Baptiste Rudant
Hello, I would like to operate in an easy and efficient way (without python loop) with arrays of matrices. Suppose a and b are some arrays of N1*N2 matrices of size 3*3, I would like to calculate inv_a and dot_ab, which would be arrays of N1*N2 (3*3)-matrices, such as : inv_a[i, j] =

Re: [Numpy-discussion] Array of matrices - Inverse and dot

2009-01-26 Thread David Cournapeau
On Mon, Jan 26, 2009 at 11:59 PM, Jean-Baptiste Rudant boogalo...@yahoo.fr wrote: Hello, I would like to operate in an easy and efficient way (without python loop) with arrays of matrices. Suppose a and b are some arrays of N1*N2 matrices of size 3*3, I would like to calculate inv_a and

Re: [Numpy-discussion] Re : Array of matrices - Inverse and dot

2009-01-26 Thread josef . pktd
On Mon, Jan 26, 2009 at 10:25 AM, Jean-Baptiste Rudant boogalo...@yahoo.fr wrote: Thank you, but my example was bad. I have to deal with matrices which can be 100*100. De : David Cournapeau courn...@gmail.com À : Discussion of Numerical Python

Re: [Numpy-discussion] Academic citation ?

2009-01-26 Thread jh
What is the most up-to-date way to cite Numpy and Scipy in an academic journal ? Cite our conference articles here: http://conference.scipy.org/proceedings/SciPy2008/index.html It would be nice if someone involved in the proceedings could post a bibtex on the citations page. And link the

Re: [Numpy-discussion] Academic citation ?

2009-01-26 Thread Pierre GM
JH, Thx for the links, but I'm afraid I need something more basic than that. For example, I'm referring to Python as: van Rossum, G. and Drake, F. L. (eds), 2006. Python Reference Manual, Python Software Foundation,. http://docs.python.org/ref/ref.html. I could indeed use

Re: [Numpy-discussion] Academic citation ?

2009-01-26 Thread Alan G Isaac
@MANUAL{ascher.dubois.hinsen.hugunin.oliphant-1999-np, author = {Ascher, David and Paul F. Dubois and Konrad Hinsen and James Hugunin and Travis Oliphant}, year = 1999, title= {Numerical Python}, edition = {UCRL-MA-128569}, address = {Livermore, CA},

Re: [Numpy-discussion] Array of matrices - Inverse and dot

2009-01-26 Thread Tom K.
Jean-Baptiste Rudant wrote: I would like to operate in an easy and efficient way (without python loop) with arrays of matrices. Suppose a and b are some arrays of N1*N2 matrices of size 3*3, I would like to calculate inv_a and dot_ab, which would be arrays of N1*N2 (3*3)-matrices,

Re: [Numpy-discussion] Academic citation ?

2009-01-26 Thread Alan G Isaac
On 1/26/2009 12:48 PM Pierre GM apparently wrote: Shouldn't we refer to the new doc.scipy.org instead of Travis' site ? Not in my opinion: Travis wrote a book, which is what is being cited. The docs link is in fact to the same tramy site. I must add that IMO, it would be a courtesy for the

[Numpy-discussion] Usage of numpy.where and pylab.find with strings

2009-01-26 Thread Ariel Rokem
Hi - I am trying to find a string in a list with strings and have come across the following state of affairs: In [228]: subjects Out[228]: ['KAA', 'CCS', 'EJS', 'MNM', 'JHS', 'LJL', 'DVA', 'FCL', 'CNC', 'KFM', 'APM', 'GMC'] In [229]: subjects[0] Out[229]: 'KAA' In [230]:

Re: [Numpy-discussion] Usage of numpy.where and pylab.find with strings

2009-01-26 Thread Robert Kern
On Mon, Jan 26, 2009 at 13:48, Ariel Rokem aro...@berkeley.edu wrote: Hi - I am trying to find a string in a list with strings and have come across the following state of affairs: In [228]: subjects Out[228]: ['KAA', 'CCS', 'EJS', 'MNM', 'JHS', 'LJL', 'DVA', 'FCL', 'CNC',

Re: [Numpy-discussion] Academic citation ?

2009-01-26 Thread Alan G Isaac
On 1/26/2009 2:37 PM Pauli Virtanen apparently wrote: Fixed, no need to be dissappointed any more. Thanks! Alan PS I hope disappointed did not sound so strong as to be discourteous. Email is tricky, and I tend to write mine with dangerous speed. ___

Re: [Numpy-discussion] Bug with mafromtxt

2009-01-26 Thread Pierre GM
On Jan 24, 2009, at 6:23 PM, Ryan May wrote: Ok, thanks. I've dug a little further, and it seems like the problem is that a column of all missing values ends up as a column of all None's. When you create a (masked) array from a list of None's, you end up with an object array. On

Re: [Numpy-discussion] Bug with mafromtxt

2009-01-26 Thread Ryan May
Pierre GM wrote: On Jan 24, 2009, at 6:23 PM, Ryan May wrote: Ok, thanks. I've dug a little further, and it seems like the problem is that a column of all missing values ends up as a column of all None's. When you create a (masked) array from a list of None's, you end up with an object

Re: [Numpy-discussion] Usage of numpy.where and pylab.find with strings

2009-01-26 Thread Ariel Rokem
Doh! That's embarrassing! Thanks! On Jan 26, 2009, at 12:00 PM, Keith Goodman wrote: On Mon, Jan 26, 2009 at 11:48 AM, Ariel Rokem aro...@berkeley.edu wrote: Hi - I am trying to find a string in a list with strings and have come across the following state of affairs: In [228]: subjects

[Numpy-discussion] numpy ndarray questions

2009-01-26 Thread Jochen
Hi all, I just wrote ctypes bindings to fftw3 (see http://projects.scipy.org/pipermail/scipy-user/2009-January/019557.html for the post to scipy). Now I have a couple of numpy related questions: In order to be able to use simd instructions I create an ndarray subclass, which uses fftw_malloc

Re: [Numpy-discussion] numpy ndarray questions

2009-01-26 Thread Ryan May
Jochen wrote: Hi all, I just wrote ctypes bindings to fftw3 (see http://projects.scipy.org/pipermail/scipy-user/2009-January/019557.html for the post to scipy). Now I have a couple of numpy related questions: In order to be able to use simd instructions I create an ndarray subclass,

Re: [Numpy-discussion] numpy ndarray questions

2009-01-26 Thread Jochen
On Mon, 2009-01-26 at 19:25 -0600, Ryan May wrote: Jochen wrote: Hi all, I just wrote ctypes bindings to fftw3 (see http://projects.scipy.org/pipermail/scipy-user/2009-January/019557.html for the post to scipy). Now I have a couple of numpy related questions: In order to be

Re: [Numpy-discussion] numpy ndarray questions

2009-01-26 Thread David Cournapeau
Jochen wrote: On Tue, 2009-01-27 at 12:49 +0900, David Cournapeau wrote: Jochen wrote: Hi all, I just wrote ctypes bindings to fftw3 (see http://projects.scipy.org/pipermail/scipy-user/2009-January/019557.html for the post to scipy). Now I have a couple of numpy related

Re: [Numpy-discussion] numpy ndarray questions

2009-01-26 Thread Jochen
On Tue, 2009-01-27 at 13:28 +0900, David Cournapeau wrote: Jochen wrote: On Tue, 2009-01-27 at 12:49 +0900, David Cournapeau wrote: Jochen wrote: Hi all, I just wrote ctypes bindings to fftw3 (see http://projects.scipy.org/pipermail/scipy-user/2009-January/019557.html

Re: [Numpy-discussion] numpy ndarray questions

2009-01-26 Thread David Cournapeau
Jochen wrote: On Tue, 2009-01-27 at 13:28 +0900, David Cournapeau wrote: Jochen wrote: On Tue, 2009-01-27 at 12:49 +0900, David Cournapeau wrote: Jochen wrote: Hi all, I just wrote ctypes bindings to fftw3 (see

Re: [Numpy-discussion] numpy ndarray questions

2009-01-26 Thread Jochen
On Tue, 2009-01-27 at 13:54 +0900, David Cournapeau wrote: Jochen wrote: On Tue, 2009-01-27 at 13:28 +0900, David Cournapeau wrote: Jochen wrote: On Tue, 2009-01-27 at 12:49 +0900, David Cournapeau wrote: Jochen wrote: Hi all, I just wrote

Re: [Numpy-discussion] numpy ndarray questions

2009-01-26 Thread David Cournapeau
Jochen wrote: On Tue, 2009-01-27 at 13:54 +0900, David Cournapeau wrote: Jochen wrote: On Tue, 2009-01-27 at 13:28 +0900, David Cournapeau wrote: Jochen wrote: On Tue, 2009-01-27 at 12:49 +0900, David Cournapeau wrote: Jochen

Re: [Numpy-discussion] numpy ndarray questions

2009-01-26 Thread Jochen
On Tue, 2009-01-27 at 14:46 +0900, David Cournapeau wrote: Jochen wrote: On Tue, 2009-01-27 at 13:54 +0900, David Cournapeau wrote: Jochen wrote: On Tue, 2009-01-27 at 13:28 +0900, David Cournapeau wrote: Jochen wrote: On Tue, 2009-01-27 at