Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-08 Thread A. M. Archibald
On 08/11/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: > It has always been my experience (on various flavors or Pentium) that > operating on NANs is extremely slow. Does anyone know on what hardware > NANs are *not* slow? Of course it's always possible I just never notice > NANs on hardware where t

Re: [Numpy-discussion] Passing numpy arrays to matlab

2006-11-08 Thread David Cournapeau
Josh Marshall wrote: > > > I don't see how you are going to get around doing the copies. Matlab > is in a separate process from the Python interpreter, and there is no > shared memory. In what way do you want these proxy classes to "look > like numpy arrays"? I am not talking about the copy in t

[Numpy-discussion] Anyone have a "little" shooting-method function to share

2006-11-08 Thread David L Goldsmith
Hi! I tried to send this earlier: it made it into my sent mail folder, but does not appear to have made it to the list. I need to numerically solve: (1-t)x" + x' - x = f(t), x(0) = x0, x(1) = x1 I've been trying to use (because it's the approach I inherited) an elementary finite-difference

[Numpy-discussion] Anyone have a "little" shooting-method function to share

2006-11-08 Thread David L Goldsmith
Hi! I need to numerically solve: (1-t)x" + x' - x = f(t), x(0) = x0, x(1) = x1 I've been trying to use (because it's the approach I inherited) an elementary finite-difference discretization, but unit tests have shown that that approach isn't working. After a little review, I believe I und

[Numpy-discussion] Help, me emails aren't getting through!

2006-11-08 Thread David L Goldsmith
If the subject line is true, no one will see this; if it's false, please ignore! :-) DG -- HMRD/ORR/NOS/NOAA - Using Tomcat but need to do more? Need to support web

[Numpy-discussion] reason

2006-11-08 Thread MONTANA NEBRASKA
Spam postage charges or strings attached Whyi!Drugs often in unable even to once. Visitor Hereplain simple.Threads Posts am Members or Welcome newest member spacerocks.Updated program French lot called mtm available address.Tsig Vermonter worzel Statistics Threads Posts Members Welcome newe

Re: [Numpy-discussion] Passing numpy arrays to matlab

2006-11-08 Thread Josh Marshall
Hi David, Sorry for the late reply. Can you CC any reply to me as well, as I just get the digests and read them every few days. On 08/11/2006, at 11:09 PM, David Cournapeau wrote: I didn't know that, thanks. Unfortunately, it is not really what I am trying to do: mlabwrap is just a python i

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-08 Thread Tim Hochberg
A. M. Archibald wrote: > On 08/11/06, Pierre GM <[EMAIL PROTECTED]> wrote: > > >> I like your idea, but not its implementation. If MA.masked_singleton is >> defined as an object, as you suggest, then the dtype of the ndarray it is >> passed to becomes 'object', as you pointed out, and that is no

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-08 Thread Paul Dubois
2 cents from the author of the first folio:The intent was to allow creation of masked arrays with copy=no, so that the original data could be retrieved from it if desired. But I was quite, quite rigorous about NEVER assuming the data in a masked slot made any sense whatsoever. The intention was tha

Re: [Numpy-discussion] Passing numpy arrays to matlab

2006-11-08 Thread David Cournapeau
Matthew Brett wrote: > > I would be very happy to help with this. It would be great if we > could get a standard well-maintained library of some sort towards > scipy - we (http://neuroimaging.scipy.org/) have a great deal of > matlab integration to do. > I am a bit busy and late on my PhD sched

Re: [Numpy-discussion] building fc6 rpm of numpy

2006-11-08 Thread Neal Becker
Try the enclosed spec file. Also, you can use the one from Fedora devel (I think the one I enclosed is the same).%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} # eval to 2.3 if python isn't yet present, wor

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Bill Baxter
Also have a look at the section on Arrays vs Matrices in the Numpy for Matlab users page. That particular section has nothing to do with Matlab, really. http://www.scipy.org/NumPy_for_Matlab_Users Most of the suggestions and comments made here are already on that page. --bb On 11/8/06, Joris De

Re: [Numpy-discussion] slice assignment: strange behaviour

2006-11-08 Thread Robert Kern
koara wrote: > koara wrote: >> Hello, >> >> a piece of my code started giving strange results with certain data; i >> managed to track down the cause to a slice array assignment. In the >> > > Also if i first build a sequence of columns and then use > numpy.transpose(numpy.vstack(sequence)) t

Re: [Numpy-discussion] building fc6 rpm of numpy

2006-11-08 Thread Albert Strasheim
Argh, On Thu, 09 Nov 2006, Albert Strasheim wrote: > %_unpackaged_files_terminate_build 1 Cut and paste error. Make that %_unpackaged_files_terminate_build 0 Cheers, Albert - Using Tomcat but need to do more? Need to sup

Re: [Numpy-discussion] building fc6 rpm of numpy

2006-11-08 Thread Albert Strasheim
Howdy On Wed, 08 Nov 2006, Vincent Broman wrote: > Building an rpm of numpy-1.0.1.dev3432-1 on fedora core 6 is failing for me. > With either python-2.4.3 or 2.4.4 I try "python setup.py bdist_rpm" > inside the source directory, and everything seems to go well except for > many "File listed twice

Re: [Numpy-discussion] slice assignment: strange behaviour

2006-11-08 Thread koara
koara wrote: > Hello, > > a piece of my code started giving strange results with certain data; i > managed to track down the cause to a slice array assignment. In the > Also if i first build a sequence of columns and then use numpy.transpose(numpy.vstack(sequence)) the result is ok. But the

[Numpy-discussion] building fc6 rpm of numpy

2006-11-08 Thread Vincent Broman
Building an rpm of numpy-1.0.1.dev3432-1 on fedora core 6 is failing for me. With either python-2.4.3 or 2.4.4 I try "python setup.py bdist_rpm" inside the source directory, and everything seems to go well except for many "File listed twice" messages for all kinds of files, and then at the end ther

[Numpy-discussion] slice assignment: strange behaviour

2006-11-08 Thread koara
Hello, a piece of my code started giving strange results with certain data; i managed to track down the cause to a slice array assignment. In the following code snip; 'mat' is a numpy.array with shape=(22973, 1009), 'vec' is a numpy.array with shape=(22973,), both of type int: for i in xrange(100

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Sven Schreiber
Johannes Loehnert schrieb: > Hi, > > in extension to the previous answers, I'd like to say that it is strongly > preferable to use dot(A,dot(B,C)) or dot(dot(A,B),C) instead of A*B*C. > > The reason is that with dot(), you can control of which operation is > performed > first, which can *massi

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-08 Thread Pierre GM
> A good candidate for "should be masked" marked is NaN. It is supposed > to mean, more or less, "no sensible value". Which might turn out out to be the best indeed. Michael's application would then look like >>> import numpy as N >>> import maskedarray as MA >>> maskit = N.nan >>> test = N.arra

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-08 Thread A. M. Archibald
On 08/11/06, Pierre GM <[EMAIL PROTECTED]> wrote: > I like your idea, but not its implementation. If MA.masked_singleton is > defined as an object, as you suggest, then the dtype of the ndarray it is > passed to becomes 'object', as you pointed out, and that is not something one > would naturally

Re: [Numpy-discussion] Calculating tan inverse

2006-11-08 Thread Francesc Altet
A Dimecres 08 Novembre 2006 18:36, amit soni escrigué: > how can I calculate arctan of a number in python? > thanks > Amit Have you tried to read the numpy docs? some googling? In general, you can get a lot of insight by querying this to Google: "your words" site:www.scipy.org in particular, try

Re: [Numpy-discussion] Calculating tan inverse

2006-11-08 Thread Nadav Horesh
There is arctan function in numpy, and in math (atan, atan2)     Nadav.   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of amit soni Sent: Wednesday, November 08, 2006 19:36 To: numpy-discussion@lists.sourceforge.net Subject: [Numpy-discussion] Calculating tan inve

[Numpy-discussion] Calculating tan inverse

2006-11-08 Thread amit soni
how can I calculate arctan of a number in python?thanksAmit Sponsored Link Mortgage rates near 39yr lows. $420,000 Mortgage for $1,399/mo - Calculate new house payment- Using Tomcat but need to do more? Need to support web s

Re: [Numpy-discussion] Profiling Python codes with hotshot and KCachegrind

2006-11-08 Thread Fernando Perez
On 11/8/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > This looks very interesting. It works for me on simple scripts, but > whenever I include the lines > > from numpy.testing import set_local_path > set_local_path('../../..') > > in the input, pycachegrind aborts with > > File > "/home

Re: [Numpy-discussion] Passing numpy arrays to matlab

2006-11-08 Thread Andrew Straw
David Cournapeau wrote: > Andrew Straw wrote: > >> David Cournapeau wrote: >> >> >>> - To send data from the calling process to matlab, you first have to >>> create a mxArray, which is the basic matlab handler of a matlab array, >>> and populating it. Using mxArray is very ackward

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Johannes Loehnert
Hi, in extension to the previous answers, I'd like to say that it is strongly preferable to use dot(A,dot(B,C)) or dot(dot(A,B),C) instead of A*B*C. The reason is that with dot(), you can control of which operation is performed first, which can *massively* influence the time needed, depending o

Re: [Numpy-discussion] Profiling Python codes with hotshot and KCachegrind

2006-11-08 Thread Stefan van der Walt
On Wed, Nov 08, 2006 at 01:32:44AM -0700, Fernando Perez wrote: > Hi all, > > in the past, Arnd Baecker has made a number of very useful posts on > this matter, and provided some nice utilities to do it. I now needed > to profile some fairly complex codes prior to a big optimization push, > so I

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Joris De Ridder
[im]: Sorry if this is an obvious question, but what is the easiest way to multiply matrices in numpy? Suppose I want to do A=B*C*D. The ' * ' operator apparently does element wise multiplication, as does the 'multiply' ufunc. [im] All I could find was the numeric function 'matrix_multipl

Re: [Numpy-discussion] reading matrix from a file

2006-11-08 Thread Francesc Altet
A Dimecres 08 Novembre 2006 15:55, Charles R Harris escrigué: > Try > > In [8]: tmp = fromfile('tmp.txt', sep=' ', dtype=int) > > In [9]: a = tmp[:4].reshape(2,2) > > In [10]: b = tmp[4:].reshape(2,2) > > In [11]: a > Out[11]: > array([[1, 2], >[3, 9]]) > > In [12]: b > Out[12]: > array([[2

Re: [Numpy-discussion] reading matrix from a file

2006-11-08 Thread Charles R Harris
On 11/8/06, Francesc Altet <[EMAIL PROTECTED]> wrote: A Dimecres 08 Novembre 2006 13:42, amit soni escrigué:> Hi,>   i have a file with following format:>  1 2>  3 9>  2 3>  4 4>I want to read it and then store the values into two matrices, s.t.>  A=[1 2;3 9]>  B=[2 3;4 4]>>   Can anyone tell

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Sven Schreiber
izak marais schrieb: > Hi > > Sorry if this is an obvious question, but what is the easiest way to > multiply matrices in numpy? Suppose I want to do A=B*C*D. The ' * ' > operator apparently does element wise multiplication, as does the > 'multiply' ufunc. All I could find was the numeric function

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Charles R Harris
On 11/8/06, Keith Goodman <[EMAIL PROTECTED]> wrote: On 11/8/06, izak marais <[EMAIL PROTECTED]> wrote:> Sorry if this is an obvious question, but what is the easiest way to> multiply matrices in numpy? Suppose I want to do A=B*C*D. The ' * ' operator > apparently does element wise multiplication,

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Albert Swart
> Izak, you should first convert you arrays to matrices using ``numpy.matrix``. or numpy.asmatrix() > > --Rob > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with p

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Roberto De Almeida
On 11/8/06, Keith Goodman <[EMAIL PROTECTED]> wrote: > > Sorry if this is an obvious question, but what is the easiest way to > > multiply matrices in numpy? Suppose I want to do A=B*C*D. > If B and C and D are matrices, then '*' is matrix multiplication. I think the difference between arrays and

Re: [Numpy-discussion] reading matrix from a file

2006-11-08 Thread Francesc Altet
A Dimecres 08 Novembre 2006 13:42, amit soni escrigué: > Hi, > i have a file with following format: > 1 2 > 3 9 > 2 3 > 4 4 >I want to read it and then store the values into two matrices, s.t. > A=[1 2;3 9] > B=[2 3;4 4] > > Can anyone tell me how to do this in python? > thanks > Am

Re: [Numpy-discussion] Passing numpy arrays to matlab

2006-11-08 Thread David Cournapeau
Andrew Straw wrote: > David Cournapeau wrote: > >> - To send data from the calling process to matlab, you first have to >> create a mxArray, which is the basic matlab handler of a matlab array, >> and populating it. Using mxArray is very ackward : you cannot create >> mxArray from existin

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Nadav Horesh
Make A,B,… matrices instead of arrays, so instead A = array((…..)) Write A = matrix((….))   Assuming you had From numpy import *     Nadav   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of izak marais Sent: Wednesday, November 08, 2006 15:54 To: numpy-discus

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Stefan van der Walt
On Wed, Nov 08, 2006 at 05:54:17AM -0800, izak marais wrote: > Hi > > Sorry if this is an obvious question, but what is the easiest way to multiply > matrices in numpy? Suppose I want to do A=B*C*D. The ' * ' operator apparently > does element wise multiplication, as does the 'multiply' ufunc. All

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Keith Goodman
On 11/8/06, izak marais <[EMAIL PROTECTED]> wrote: > Sorry if this is an obvious question, but what is the easiest way to > multiply matrices in numpy? Suppose I want to do A=B*C*D. The ' * ' operator > apparently does element wise multiplication, as does the 'multiply' ufunc. > All I could find w

[Numpy-discussion] reading matrix from a file

2006-11-08 Thread amit soni
Hi, i have a file with following format: 1 2 3 9 2 3 4 4I want to read it and then store the values into two matrices, s.t. A=[1 2;3 9] B=[2 3;4 4]Can anyone tell me how to do this in python? thanks Amit Check out the all-new Yahoo! Mail - Fire up a more powerful email and get

[Numpy-discussion] Warning: message 1Ggbsf-00056T-Ol delayed 72 hours

2006-11-08 Thread Mail Delivery System
This message was created automatically by mail delivery software. A message that you sent has not yet been delivered to one or more of its recipients after more than 72 hours on the queue on externalmx-1.sourceforge.net. The message identifier is: 1Ggbsf-00056T-Ol The subject of the message i

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-08 Thread Pierre GM
Michael, First of all, thanks for your interest in the exercise of style the new implementation of MaskedArray is basically nothing but. On Tuesday 07 November 2006 20:11, Michael Sorich wrote: > 1. It would be nice if the masked_singleton could be passed into a > ndarray, as this would allow it

[Numpy-discussion] Profiling Python codes with hotshot and KCachegrind

2006-11-08 Thread Fernando Perez
Hi all, in the past, Arnd Baecker has made a number of very useful posts on this matter, and provided some nice utilities to do it. I now needed to profile some fairly complex codes prior to a big optimization push, so I went over his material and wrote a little tool to make the whole process as