Re: [Numpy-discussion] very large matrices.

2007-05-14 Thread Dave P. Novakovic
Thank you all for your suggestions. I'm taking the time to look into all of them properly. Giorgio: A cursory glance looks promising there, thanks. Zachary: Brilliant, that looks great. val: What you are saying is correct, at the moment I'm taking 2 lines of context around each instance of the t

Re: [Numpy-discussion] very large matrices.

2007-05-14 Thread val
Dave, I'm may be totally wrong, but i have intuitive feeling that your problem may be reformulated with focus on separation of a "basic" physical (vs. mathematical) 'core' and the terms which depend on a reasonable "small parameter". In other words, my point is to build a simplified model pro

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Robert Kern
Alexander Schmolck wrote: > Robert Kern <[EMAIL PROTECTED]> writes: > >> Alexander Schmolck wrote: >>> Robert Kern <[EMAIL PROTECTED]> writes: >>> If possible, I would prefer a way to pass a value to use and raise the error if no such value is passed rather than hardcode an identit

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Alexander Schmolck
Robert Kern <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: >> Robert Kern <[EMAIL PROTECTED]> writes: >> >>> If possible, I would prefer a way to pass a value to use and raise the >>> error if >>> no such value is passed rather than hardcode an identity value for min() >>> and max(). >

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Robert Kern
Alexander Schmolck wrote: > Robert Kern <[EMAIL PROTECTED]> writes: > >> If possible, I would prefer a way to pass a value to use and raise the error >> if >> no such value is passed rather than hardcode an identity value for min() and >> max(). > > What's wrong with inf? I'm not sure integer r

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 8, Issue 28

2007-05-14 Thread Nick Fotopoulos
On 5/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Message: 3 > Date: Mon, 14 May 2007 14:21:50 -0400 > From: "David M. Cooke" <[EMAIL PROTECTED]> > Subject: Re: [Numpy-discussion] .max() and zero length arrays > To: Discussion of Numerical Python > Message-ID: <[EMAIL PROTECTED]> > Conte

Re: [Numpy-discussion] numpy array sharing between processes? (and ctypes)

2007-05-14 Thread Stefan van der Walt
On Mon, May 14, 2007 at 11:44:11AM -0700, Ray S wrote: > While investigating ctypes and numpy for sharing, I saw that the > example on > http://www.scipy.org/Cookbook/Ctypes#head-7def99d882618b52956c6334e08e085e297cb0c6 > does not quite work. However, with numpy.version.version=='1.0b1', > Active

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Alexander Schmolck
Robert Kern <[EMAIL PROTECTED]> writes: > If possible, I would prefer a way to pass a value to use and raise the error > if > no such value is passed rather than hardcode an identity value for min() and > max(). What's wrong with inf? I'm not sure integer reductions should have max/min-ints as

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Robert Kern
David M. Cooke wrote: > On Mon, May 14, 2007 at 12:38:58PM -0500, Nick Fotopoulos wrote: >> Dear all, >> >> I find myself frequently wanting to take the max of an array that >> might have zero length. If it is zero length, it throws an exception, >> when I would like to gracefully substitute my ow

Re: [Numpy-discussion] numpy array sharing between processes? (and ctypes)

2007-05-14 Thread Travis Oliphant
Ray S wrote: > print N.diag(x) > > Works for me... > > I can then do: > >>> import numpy.core.multiarray as MA > >>> xBuf = MA.getbuffer(x) > >>> z = MA.frombuffer(xBuf).reshape((3,3)) > I see this kind of importing used more often than it should be. It is dangerous to import directly fro

Re: [Numpy-discussion] numpy array sharing between processes? (and ctypes)

2007-05-14 Thread Ray S
While investigating ctypes and numpy for sharing, I saw that the example on http://www.scipy.org/Cookbook/Ctypes#head-7def99d882618b52956c6334e08e085e297cb0c6 does not quite work. However, with numpy.version.version=='1.0b1', ActivePython 2.4.3 Build 12: import numpy as N from ctypes import * x

Re: [Numpy-discussion] howto make from flat array (1-dim) 2-dimensional?

2007-05-14 Thread Christopher Barker
or: a=array([1,2,3]).reshape((-1,1)) Darn, I guess there is more than one obvious way to do it! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115

Re: [Numpy-discussion] argsort and take along arbitrary axes

2007-05-14 Thread Charles R Harris
On 5/14/07, Zachary Pincus <[EMAIL PROTECTED]> wrote: >> I've got a few questions that came up as I tried to calculate various >> statistics about an image time-series. For example, I have an array >> of shape (t,x,y) representing t frames of a time-lapse of resolution >> (x,y). >> >> Now, say I

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread David M. Cooke
On Mon, May 14, 2007 at 12:38:58PM -0500, Nick Fotopoulos wrote: > Dear all, > > I find myself frequently wanting to take the max of an array that > might have zero length. If it is zero length, it throws an exception, > when I would like to gracefully substitute my own value. For example, > one

[Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Nick Fotopoulos
Dear all, I find myself frequently wanting to take the max of an array that might have zero length. If it is zero length, it throws an exception, when I would like to gracefully substitute my own value. For example, one solution with lists is to do max(possibly_empty_list + [minimum_value]), but

Re: [Numpy-discussion] very large matrices.

2007-05-14 Thread Zachary Pincus
Hello Dave, I don't know if this will be useful to your research, but it may be worth pointing out in general. As you know PCA (and perhaps some other spectral algorithms?) use eigenvalues of matrices that can be factored out as A'A (where ' means transpose). For example, in the PCA case,

Re: [Numpy-discussion] argsort and take along arbitrary axes

2007-05-14 Thread Zachary Pincus
>> I've got a few questions that came up as I tried to calculate various >> statistics about an image time-series. For example, I have an array >> of shape (t,x,y) representing t frames of a time-lapse of resolution >> (x,y). >> >> Now, say I want to both argsort and sort this time-series, pixel- >

Re: [Numpy-discussion] argsort and take along arbitrary axes

2007-05-14 Thread Charles R Harris
On 5/13/07, Zachary Pincus <[EMAIL PROTECTED]> wrote: Hello all, I've got a few questions that came up as I tried to calculate various statistics about an image time-series. For example, I have an array of shape (t,x,y) representing t frames of a time-lapse of resolution (x,y). Now, say I want

Re: [Numpy-discussion] best way of counting time and cputime?

2007-05-14 Thread [EMAIL PROTECTED]
> Is the genutils module not included to standard CPython edition? It's not. It's a sub-module of IPython. It's based on the resource module,though and that comes with Python on Linux. Just define the function Fernando posted: > > def clock(): > > """clock() -> floating point number

Re: [Numpy-discussion] NumPy 1.0.3 release next week

2007-05-14 Thread Johannes Loehnert
Hi, in error logs as yours, always look for the first line which says "error". If it is, like in your case, something like On Sunday, 13. May 2007 19:21:15 dmitrey wrote: > /usr/lib/gcc/x86_64-linux-gnu/4.1.2/include/limits.h:122:61: error: > limits.h: No such file or directory you are missing

[Numpy-discussion] argsort and take along arbitrary axes

2007-05-14 Thread Zachary Pincus
Hello all, I've got a few questions that came up as I tried to calculate various statistics about an image time-series. For example, I have an array of shape (t,x,y) representing t frames of a time-lapse of resolution (x,y). Now, say I want to both argsort and sort this time-series, pixel-

Re: [Numpy-discussion] very large matrices.

2007-05-14 Thread Giorgio Luciano
If you are using it for making a PCA, why dont' you try to use nipals algorithm ? (probably a silly question , just wanted to give help :) Giorgio > > ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listi