Re: [Numpy-discussion] scalar recordarrays

2007-03-21 Thread Matthew Koichi Grimes
If there are no objections, I'll file this ticket in the trac site: Title: Return type inconsistency in recarray Description: The sub-arrays of rank-0 recarrays are returned as scalars rather than rank-0 ndarrays. Example: >>> import numpy as N >>> dt = N.dtype([('x','f8'),('y','f8')]) >>>

[Numpy-discussion] loess (was Re: distutils for a Pyrex module)

2007-03-21 Thread Pierre GM
On Tuesday 20 March 2007 18:57:18 Robert Kern wrote: > Is there an init_loess function in cloess.c? If cloess.c was created by > Pyrex from cloess.pyx, then Pyrex will make an initcloess function. The > module name needs to be consistent throughout. Ahah, that was the problem. Thanks a lot Robert,

Re: [Numpy-discussion] memory leak w/ numpy & Numeric together

2007-03-21 Thread Travis Oliphant
Bryan Cole wrote: >I'm not sure where best to post this, but I get a memory leak when using >code with both numpy and FFT(from Numeric) together: > >e.g. > > > import numpy import FFT def test(): >... while 1: >... data=numpy.random.random(2048) >...

[Numpy-discussion] memory leak w/ numpy & Numeric together

2007-03-21 Thread Bryan Cole
I'm not sure where best to post this, but I get a memory leak when using code with both numpy and FFT(from Numeric) together: e.g. >>> import numpy >>> import FFT >>> def test(): ... while 1: ... data=numpy.random.random(2048) ... newdata = FFT.real_fft(data) >>> test() and m

Re: [Numpy-discussion] Little module to get numpy examples

2007-03-21 Thread Bill Baxter
On 3/22/07, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > On Wed, Mar 21, 2007 at 02:59:06PM -0500, eric jones wrote: > > Just looked at this... Now that is just cool. > > > > I'd say it should be part of Numpy. > > Very useful! A file cache would be handy, and can be implemented > using the c

Re: [Numpy-discussion] Little module to get numpy examples

2007-03-21 Thread Stefan van der Walt
On Wed, Mar 21, 2007 at 02:59:06PM -0500, eric jones wrote: > Just looked at this... Now that is just cool. > > I'd say it should be part of Numpy. Very useful! A file cache would be handy, and can be implemented using the checksum of the page from http://www.scipy.org/Numpy_Example_List?acti

Re: [Numpy-discussion] Little module to get numpy examples

2007-03-21 Thread eric jones
Just looked at this... Now that is just cool. I'd say it should be part of Numpy. eric Bill Baxter wrote: > On 3/19/07, Bill Baxter <[EMAIL PROTECTED]> wrote: > >> I wrote a little python module to go fetch the Numpy examples from the >> scipy wiki page, parse them, and print out entries. >

Re: [Numpy-discussion] Adapting algorithm to accept Scipy sparse matrix

2007-03-21 Thread David Koch
Alright, may all the trickery rest until that day. One thing I need to do however is patch a column of "ones" onto a sparse matrix of format n * d with n >> d. I tried "concatenate" and it didn't work so I did like this: def spInsCol(X): "insert doc string" n, d = shape(X) X = X.tocsc(

Re: [Numpy-discussion] Translation of Matlab function find()

2007-03-21 Thread Francesc Altet
El dc 21 de 03 del 2007 a les 09:23 +0100, en/na Miquel Poch va escriure: > Hi, > > I'm trying to translate some Matlab functions. I don't know exactly > how make and equivalent for function find(). This give us the index of > an array where a condition it's true. > > I've found some options like

Re: [Numpy-discussion] problems building exported version of numpy from svn

2007-03-21 Thread Robert Kern
Fred Romelfanger wrote: > When I use co to check the code out of svn, running setup.py and building > the code works fine, but when I export the code or create a source > distribution that includes numpy the .svn directories get stripped. > > svn export http://svn.scipy.org/svn/numpy/trunk numpy >

Re: [Numpy-discussion] Translation of Matlab function find()

2007-03-21 Thread Robert Kern
Miquel Poch wrote: > Hi, > > I'm trying to translate some Matlab functions. I don't know exactly how > make and equivalent for function find(). This give us the index of an > array where a condition it's true. > > I've found some options like this one: (a>0).nonzero(), where a is the > array and

Re: [Numpy-discussion] basearray & dimarray : you have dead URL; + some questions

2007-03-21 Thread Robert Kern
dmitrey wrote: > Hallo! > Excuse my bad English. > > In the web page > http://www.scipy.org/BaseArray/Application > in the section Note that this was an application for last year's GSoC. It's not an idea for this year's GSoC. > Now I'm writing some code and want to know, what will dotwise and ma

[Numpy-discussion] problems building exported version of numpy from svn

2007-03-21 Thread Fred Romelfanger
When I use co to check the code out of svn, running setup.py and building the code works fine, but when I export the code or create a source distribution that includes numpy the .svn directories get stripped. svn export http://svn.scipy.org/svn/numpy/trunk numpy I then get the following error whe

Re: [Numpy-discussion] Translation of Matlab function find()

2007-03-21 Thread Miquel Poch
Hi, I'm trying to translate some Matlab functions. I don't know exactly how make and equivalent for function find(). This give us the index of an array where a condition it's true. I've found some options like this one: (a>0).nonzero(), where a is the array and (a>0) the condition. But the probl

[Numpy-discussion] Grouping & Collapsing multi-dimensional data

2007-03-21 Thread Mike Biglan
I might be using the wrong terminology but I'm trying to take a 2d array where each row has a department object and then 36 floats after it, eg: [dept1, 3,6,7...] With SQL or R i know how to collapse a simple 2d data structure like this. For example in SQL: select dept, stddev(field1)... from tbl_

[Numpy-discussion] basearray & dimarray : you have dead URL; + some questions

2007-03-21 Thread dmitrey
Hallo! Excuse my bad English. In the web page http://www.scipy.org/BaseArray/Application in the section Project details and tentative schedule you refer to the dead link with name http://numeric.scipy.org/array_interface.html which leads to http://numpy.scipy.org//array_interface.html whi

Re: [Numpy-discussion] Array of Callables

2007-03-21 Thread Anne Archibald
On 21/03/07, Andrew Corrigan <[EMAIL PROTECTED]> wrote: > Thanks for pointing that out. Technically that works, but it doesn't really > express this operation as concisely and as naturally as I'd like to be able > to. > > What I really want is to be able to write: > > >>> a = array([lambda x: x**

Re: [Numpy-discussion] Array of Callables

2007-03-21 Thread Andrew Corrigan
Good point! I think I will, Thanks a lot. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Array of Callables

2007-03-21 Thread Shane Holloway
On Mar 21, 2007, at 6:58 AM, Anne Archibald wrote: > Vectorizing apply is what you're looking for, by the sound of it: > In [13]: a = array([lambda x: x**2, lambda x: x**3]) > > In [14]: b = arange(5) > > In [15]: va = vectorize(lambda f, x: f(x)) > > In [16]: va(a[:,newaxis],b[newaxis,:]) > Out[

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

2007-03-21 Thread David Koch
Ah! So much ado about nothing. What I was looking for was in fact: B[A_idx][:,A_idx] ... it's even explained in the the NumPy for Matlab Users doc on scipy.org /Thank you ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.sci

Re: [Numpy-discussion] Adapting algorithm to accept Scipy sparse matrix

2007-03-21 Thread Steve Lianoglou
Hi David, > The "worst" problem I encountered is that sparse matrices do not > seem to support the kind of indexing I need. At least I get > "NotImplementedError: sequence indexing not yet fully supported" > and " supports slices only of a single row" > errors all the time. I agree .. thi

Re: [Numpy-discussion] Array of Callables

2007-03-21 Thread Michael McLay
On Wednesday 21 March 2007 09:52, Andrew Corrigan wrote: > Anne Archibald gmail.com> writes: > > Vectorizing apply is what you're looking for, by the sound of it: > > In [13]: a = array([lambda x: x**2, lambda x: x**3]) > > > > In [14]: b = arange(5) > > > > In [15]: va = vectorize(lambda f, x: f(

Re: [Numpy-discussion] Adapting algorithm to accept Scipy sparse matrix

2007-03-21 Thread David Koch
Ok, I will bump this once ... The "worst" problem I encountered is that sparse matrices do not seem to support the kind of indexing I need. At least I get "NotImplementedError: sequence indexing not yet fully supported" and " supports slices only of a single row" errors all the time. Any advice

Re: [Numpy-discussion] Array of Callables

2007-03-21 Thread Andrew Corrigan
Anne Archibald gmail.com> writes: > Vectorizing apply is what you're looking for, by the sound of it: > In [13]: a = array([lambda x: x**2, lambda x: x**3]) > > In [14]: b = arange(5) > > In [15]: va = vectorize(lambda f, x: f(x)) > > In [16]: va(a[:,newaxis],b[newaxis,:]) > Out[16]: > array([

Re: [Numpy-discussion] Array of Callables

2007-03-21 Thread Anne Archibald
On 21/03/07, Andrew Corrigan <[EMAIL PROTECTED]> wrote: > This is a feature I've been wanting for a long time, so I'm really glad that > Shane brought this up. > > While I was hoping for a gain in speed, that isn't the only reason that I > would > like to see this added. In fact, the most compel

Re: [Numpy-discussion] Array of Callables

2007-03-21 Thread Andrew Corrigan
Robert Kern gmail.com> writes: > > Shane Holloway wrote: > > To the vector-processing masters of numpy! > > > > I'm wanting to optimize calling a list (or array) of callable > > objects. Consider the following: > > > > vCallables = numpy.array([ > classes, builtin functions>]) > > vParam1

Re: [Numpy-discussion] PyChecker

2007-03-21 Thread Alexandre Fayolle
On Tue, Mar 20, 2007 at 08:48:46PM -0600, Charles R Harris wrote: > On 3/20/07, Pierre GM <[EMAIL PROTECTED]> wrote: > > > >On Tuesday 20 March 2007 15:29:01 Charles R Harris wrote: > >> but I want > >> to suggest that we run pychecker, and maybe pylint, over the python code > >to > >> look for err