Re: [Numpy-discussion] LU factorization?

2008-10-14 Thread Stéfan van der Walt
2008/10/15 Charles R Harris <[EMAIL PROTECTED]>: > numpy.linalg has qr and cholesky factorizations, but LU factorization is > only available in scipy. That doesn't seem quite right. I think is would > make sense to include the LU factorization in numpy among the basic linalg > operations, and proba

[Numpy-discussion] LU factorization?

2008-10-14 Thread Charles R Harris
Hi All, numpy.linalg has qr and cholesky factorizations, but LU factorization is only available in scipy. That doesn't seem quite right. I think is would make sense to include the LU factorization in numpy among the basic linalg operations, and probably LU_solve also. Thoughts? Chuck

Re: [Numpy-discussion] how to save a large array into a file quickly

2008-10-14 Thread Eric Firing
frank wang wrote: > Hi, > > I have a large ndarray that I want to dump to a file. I know that I can > use a for loop to write one data at a time. Since Python is a very > powerfully language, I want to find a way that will dump the data fast > and clean. The data can be in floating point or in

Re: [Numpy-discussion] memory usage

2008-10-14 Thread Huang-Wen Chen
Robert Kern wrote: >> from numpy import * >> for i in range(1000): >> a = random.randn(512**2) >> b = a.argsort(kind='quick') > > Can you try upgrading to numpy 1.2.0? On my machine with numpy 1.2.0 > on OS X, the memory usage is stable. > I tried the code fragment on two platforms and the m

[Numpy-discussion] how to save a large array into a file quickly

2008-10-14 Thread frank wang
Hi, I have a large ndarray that I want to dump to a file. I know that I can use a for loop to write one data at a time. Since Python is a very powerfully language, I want to find a way that will dump the data fast and clean. The data can be in floating point or integer. Thanks Frank _

Re: [Numpy-discussion] memory usage

2008-10-14 Thread Robert Kern
On Tue, Oct 14, 2008 at 17:02, emil <[EMAIL PROTECTED]> wrote: > Hi, > I'm having a problem with my python code, using numpy, chewing up too > much memory. > In the following, I boiled down my program to the simplest example that > has the problem: > > from numpy import * > for i in range(1000):

[Numpy-discussion] memory usage

2008-10-14 Thread emil
Hi, I'm having a problem with my python code, using numpy, chewing up too much memory. In the following, I boiled down my program to the simplest example that has the problem: from numpy import * for i in range(1000): a = random.randn(512**2) b = a.argsort(kind='quick') This loop takes a

Re: [Numpy-discussion] SWIG, typemaps, 2D argout arrays

2008-10-14 Thread Sebastian Haase
On Tue, Oct 14, 2008 at 7:51 PM, T J <[EMAIL PROTECTED]> wrote: > On Tue, Oct 14, 2008 at 1:02 AM, Sebastian Haase <[EMAIL PROTECTED]> wrote: >> b) I don't want to use Python / numpy API code in the C functions I'm >> wrapping - so I limit myself to "input" arrays! Since array memory >> does not di

Re: [Numpy-discussion] SWIG, typemaps, 2D argout arrays

2008-10-14 Thread Christopher Barker
>> It seems like I should use: >> >> (int* ARGOUT_ARRAY1, int DIM1) >> >> and then provide a python function which reshapes the 1D array? Oh, another option is to use: ( DATA_TYPE* INPLACE_FARRAY2, int DIM1, int DIM2 ) and create the array in python first. This could be done with a little wr

Re: [Numpy-discussion] SWIG, typemaps, 2D argout arrays

2008-10-14 Thread Christopher Barker
T J wrote: > I'm new to using SWIG and my reading of numpy_swig.pdf tells me that > the following typemap does not exist: > > (int* ARGOUT_ARRAY2, int DIM1, int DIM2) are you referring to this statement in the docs? """ Note that we support DATA_TYPE* argout typemaps in 1D, but not 2D or 3D.

Re: [Numpy-discussion] SWIG, typemaps, 2D argout arrays

2008-10-14 Thread T J
On Tue, Oct 14, 2008 at 1:02 AM, Sebastian Haase <[EMAIL PROTECTED]> wrote: > b) I don't want to use Python / numpy API code in the C functions I'm > wrapping - so I limit myself to "input" arrays! Since array memory > does not distinguish between input or output (assuming there is no > copying nee

Re: [Numpy-discussion] basic install question

2008-10-14 Thread Robert Kern
On Tue, Oct 14, 2008 at 11:12, <[EMAIL PROTECTED]> wrote: > Do I need ATLAS to install NumPy? No. > Apologies if this is in the archives somewhere, but I can't find it, and I > can't figure it out from http://www.scipy.org/Installing_SciPy/Linux. > Clearly you need some kind of BLAS/ LAPACK, but

[Numpy-discussion] basic install question

2008-10-14 Thread peter_williams
Do I need ATLAS to install NumPy? Apologies if this is in the archives somewhere, but I can't find it, and I can't figure it out from http://www.scipy.org/Installing_SciPy/Linux. Clearly you need some kind of BLAS/ LAPACK, but it's not clear if ATLAS required, or is just one option of many.

Re: [Numpy-discussion] Apply a vector function to each row of a matrix

2008-10-14 Thread Neal Becker
David Huard wrote: ... > I've edited the docstring at > http://sd-2116.dedibox.fr/pydocweb/doc/numpy.lib.shape_base.apply_along_axis/ > > Feel free to improve on it. Thanks! That is better. ___ Numpy-discussion mailing list Numpy-discussion@scipy.or

Re: [Numpy-discussion] Python equivalent to Matlab control systems/ LTI/state space model manipulation tools

2008-10-14 Thread Stéfan van der Walt
Hi Scott 2008/10/14 Scott Askey <[EMAIL PROTECTED]>: > Where is a good place to look for python funtions similar to Matlab's > ss , tf, ss2tf as use for transforming a linear time invariant(LTI) model > into a state space model. Look under scipy.signal. These utilities need a lot of work, so if

Re: [Numpy-discussion] Python equivalent to Matlab control systems/ LTI/state space model manipulation tools

2008-10-14 Thread Andrew Straw
Ryan Krauss has been working on something, although I have not had a chance to try it. http://www.siue.edu/~rkrauss/python_intro.html Scott Askey wrote: > Where is a good place to look for python funtions similar to Matlab's > ss , tf, ss2tf as use for transforming a linear time invariant(LTI) mo

[Numpy-discussion] Python equivalent to Matlab control systems/ LTI/state space model manipulation tools

2008-10-14 Thread Scott Askey
Where is a good place to look for python funtions similar to Matlab's ss , tf, ss2tf as use for transforming a linear time invariant(LTI) model into a state space model. V/R Scott http://www.mathworks.com/access/helpdesk/help/toolbox/control/ __

Re: [Numpy-discussion] matlab ss2tf in python/symbols in linear

2008-10-14 Thread Scott Askey
The numpy poly function work to solve most of my problem. As soon as I realized the poly in numpy base and matlab perform the same funtion I was ble to efficintly transform my state space model (A B C D ) into polynomial transfer funtions. H=num/den num=(poly(A-dot(B,C))-poly(A)) den =

Re: [Numpy-discussion] SWIG, typemaps, 2D argout arrays

2008-10-14 Thread Sebastian Haase
On Tue, Oct 14, 2008 at 6:40 AM, T J <[EMAIL PROTECTED]> wrote: > Hi, > > I'm new to using SWIG and my reading of numpy_swig.pdf tells me that > the following typemap does not exist: > > (int* ARGOUT_ARRAY2, int DIM1, int DIM2) > > What is the recommended way to output a 2D array? It seems like I