[SciPy-user] newbie: easy question (I hope)

Chiara Caronna chiaracaronna@hotmail....
Mon Feb 5 13:25:49 CST 2007




>From: Travis Oliphant <oliphant@ee.byu.edu>
>Reply-To: SciPy Users List <scipy-user@scipy.org>
>To: SciPy Users List <scipy-user@scipy.org>
>Subject: Re: [SciPy-user] newbie: easy question (I hope)
>Date: Mon, 05 Feb 2007 12:20:59 -0700
>
>Chiara Caronna wrote:
>
> >Hi,
> >I have an old code, where I used numarray, and there is this command:
> >where c is a 1d array
> >
> >c= unpack(format, string)
> >ccdimage=N.array(c,shape=[nrows,ncol])
> >
> >if I use array from numpy I got this error:
> >
> >"shape is an invalid keyword argument for this function"
> >I need to transform c in an array of shape [nrows,ncol], how can I do it
> >with numpy?
> >
> >
>What exactly are you asking?
>
>If you want to use numarray-compatibile syntax then use the
>numpy.numarray module like this
>
>import numpy.numarray as N
>
>This is a compatibility-layer and is not recommended except for porting
>older code.
>
>Otherwise you change the shape of an array using the reshape method or
>setting the shape attribute of an ndarray.
>

Actually I wanted to remove all the numarray syntax from my code... they are 
not so much and I prefer to have a "cleaner" code.
I used the reshape method, thanks

Chiara

>-Travis
>
>_______________________________________________
>SciPy-user mailing list
>SciPy-user@scipy.org
>http://projects.scipy.org/mailman/listinfo/scipy-user

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



More information about the SciPy-user mailing list