[Numpy-discussion] Warnings in numpy.ma.test()

2010-03-16 Thread Pierre GM
All, As you're probably aware, the current test suite for numpy.ma raises some nagging warnings such as "invalid value in ...". These warnings are only issued when a standard numpy ufunc (eg., np.sqrt) is called on a MaskedArray, instead of its numpy.ma (eg., np.ma.sqrt) equivalent. The reason i

Re: [Numpy-discussion] Subclassing ma.MaskedArray

2010-03-16 Thread Matt Knox
David Carmean halibut.com> writes: > > > I understand that ma.MaskedArray is a subclass of ndarray; in addition to > the requirements for subclassing the latter, what does ma.MaskedArray add to > the list? I.e. what do I have to watch out for? You may want to take a look at the TimeSeries cl

[Numpy-discussion] Subclassing ma.MaskedArray

2010-03-16 Thread David Carmean
I understand that ma.MaskedArray is a subclass of ndarray; in addition to the requirements for subclassing the latter, what does ma.MaskedArray add to the list? I.e. what do I have to watch out for? Basically I need a version of Luke Campagnola's MetaArray ( http://www.scipy.org/Cookbook/M

[Numpy-discussion] f2py compiler version errors

2010-03-16 Thread Peter Brady
Hello all, The version of f2py that's installed on our system doesn't appear to handle version numbers correctly. I've attached the relevant output of f2py below: customize IntelFCompiler > Couldn't match compiler version for 'Intel(R) Fortran Intel(R) 64 Compiler > Professional for applications

Re: [Numpy-discussion] Some help on matlab to numpy translation

2010-03-16 Thread Friedrich Romstedt
Ok, maybe can you print shape of the {rho} array as calculated my matlab? I know that sum() in matlab sums over rows (i.e., the first dimension), but I'm curious if it returns for an, say, (10x20) array an (20,) array or an (1, 20) array. And to Josef: cx is an 1d vector, so no. And Hmmm ... mos

Re: [Numpy-discussion] How to fix the diagonal values of a matrix

2010-03-16 Thread josef . pktd
On Tue, Mar 16, 2010 at 1:57 PM, Keith Goodman wrote: > On Tue, Mar 16, 2010 at 7:43 AM, Keith Goodman wrote: >> On Tue, Mar 16, 2010 at 5:56 AM,   wrote: >>> On Tue, Mar 16, 2010 at 9:43 AM, gerardo.berbeglia >>> wrote: How can i take out the diagonal values of a matrix and fix them

Re: [Numpy-discussion] How to fix the diagonal values of a matrix

2010-03-16 Thread Keith Goodman
On Tue, Mar 16, 2010 at 7:43 AM, Keith Goodman wrote: > On Tue, Mar 16, 2010 at 5:56 AM,   wrote: >> On Tue, Mar 16, 2010 at 9:43 AM, gerardo.berbeglia >> wrote: >>> >>> How can i take out the diagonal values of a matrix and fix them to zero? >>> >>> Example: >>> >>> input: [[2,3,4],[3,4,5],[4,5

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread David Goldsmith
On Tue, Mar 16, 2010 at 9:45 AM, Sam Tygier wrote: > On Tue, Mar 16, 2010 at 12:23 PM,   gmail.com> wrote: >> You can file a ticket, but if this is a function that is already in >> real use, then it would be an unpleasant break in the API > > done > http://projects.scipy.org/numpy/ticket/1431 > >

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread Sam Tygier
On Tue, Mar 16, 2010 at 12:23 PM, gmail.com> wrote: > You can file a ticket, but if this is a function that is already in > real use, then it would be an unpleasant break in the API done http://projects.scipy.org/numpy/ticket/1431 thanks Sam ___ NumP

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread Skipper Seabold
On Tue, Mar 16, 2010 at 12:23 PM, wrote: > On Tue, Mar 16, 2010 at 12:04 PM, Sam Tygier > wrote: >> On Tue, Mar 16, 2010 at 11:34 AM, Skipper Seabold >> wrote: so i always get the vales back in the original order. is the by design, or a bug? >>> >>> I've been bitten by this bef

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread josef . pktd
On Tue, Mar 16, 2010 at 12:04 PM, Sam Tygier wrote: > On Tue, Mar 16, 2010 at 11:34 AM, Skipper Seabold wrote: >>> so i always get the vales back in the original order. is the by design, or >>> a bug? >>> >> >> I've been bitten by this before too and asked the same question with >> no response.

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread josef . pktd
On Tue, Mar 16, 2010 at 12:08 PM, wrote: > On Tue, Mar 16, 2010 at 11:52 AM, Skipper Seabold wrote: >> On Tue, Mar 16, 2010 at 11:46 AM,   wrote: >>> On Tue, Mar 16, 2010 at 11:34 AM, Skipper Seabold >>> wrote: On Tue, Mar 16, 2010 at 11:20 AM, Sam Tygier wrote: > Thanks for tho

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread josef . pktd
On Tue, Mar 16, 2010 at 11:52 AM, Skipper Seabold wrote: > On Tue, Mar 16, 2010 at 11:46 AM,   wrote: >> On Tue, Mar 16, 2010 at 11:34 AM, Skipper Seabold >> wrote: >>> On Tue, Mar 16, 2010 at 11:20 AM, Sam Tygier >>> wrote: Thanks for those responses. could the dtype pages in th

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread Sam Tygier
On Tue, Mar 16, 2010 at 11:34 AM, Skipper Seabold wrote: >> so i always get the vales back in the original order. is the by design, or a >> bug? >> > > I've been bitten by this before too and asked the same question with > no response. I think it's just a limitation of the design of > structured

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread Skipper Seabold
On Tue, Mar 16, 2010 at 11:46 AM, wrote: > On Tue, Mar 16, 2010 at 11:34 AM, Skipper Seabold wrote: >> On Tue, Mar 16, 2010 at 11:20 AM, Sam Tygier >> wrote: >>> Thanks for those responses. >>> >>> could the dtype pages in the numpy reference link to the basics.rec page in >>> the user guide?

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread Skipper Seabold
On Tue, Mar 16, 2010 at 11:34 AM, Skipper Seabold wrote: > On Tue, Mar 16, 2010 at 11:20 AM, Sam Tygier > wrote: >> Thanks for those responses. >> >> could the dtype pages in the numpy reference link to the basics.rec page in >> the user guide? >> >> there seem to be some gotchas in list within

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread josef . pktd
On Tue, Mar 16, 2010 at 11:34 AM, Skipper Seabold wrote: > On Tue, Mar 16, 2010 at 11:20 AM, Sam Tygier > wrote: >> Thanks for those responses. >> >> could the dtype pages in the numpy reference link to the basics.rec page in >> the user guide? >> >> there seem to be some gotchas in list within

Re: [Numpy-discussion] Array mapping question

2010-03-16 Thread Jorge Scandaliaris
gmail.com> writes: > If I remember correctly it was unique1d in numpy 1.3 that had the > return_inverse options. > > Check the functions in arraysetops for numpy 1.3. > unique1d is in my help file for numpy 1.2 (which was the fastest for > me to look up) > You're right, again. unique1d is in

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread Skipper Seabold
On Tue, Mar 16, 2010 at 11:20 AM, Sam Tygier wrote: > Thanks for those responses. > > could the dtype pages in the numpy reference link to the basics.rec page in > the user guide? > > there seem to be some gotchas in list within a list notation. > > if i have > a = array([0,0.1,0.2,0.3,0.4]) > b

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread Sam Tygier
Thanks for those responses. could the dtype pages in the numpy reference link to the basics.rec page in the user guide? there seem to be some gotchas in list within a list notation. if i have a = array([0,0.1,0.2,0.3,0.4]) b = array((0,0.1,0.2,0.3,0.4), dtype=[('a','f'), ('b','f'), ('c','f'),

Re: [Numpy-discussion] How to fix the diagonal values of a matrix

2010-03-16 Thread Keith Goodman
On Tue, Mar 16, 2010 at 5:56 AM, wrote: > On Tue, Mar 16, 2010 at 9:43 AM, gerardo.berbeglia > wrote: >> >> How can i take out the diagonal values of a matrix and fix them to zero? >> >> Example: >> >> input: [[2,3,4],[3,4,5],[4,5,6]] >> >> output: [[0,3,4],[3,0,5],[4,5,0]] > > assuming a is sq

Re: [Numpy-discussion] How to fix the diagonal values of a matrix

2010-03-16 Thread josef . pktd
On Tue, Mar 16, 2010 at 9:43 AM, gerardo.berbeglia wrote: > > How can i take out the diagonal values of a matrix and fix them to zero? > > Example: > > input: [[2,3,4],[3,4,5],[4,5,6]] > > output: [[0,3,4],[3,0,5],[4,5,0]] assuming a is square a[range(len(a)),range(len(a))] = 0 see also np.diag

[Numpy-discussion] How to fix the diagonal values of a matrix

2010-03-16 Thread gerardo.berbeglia
How can i take out the diagonal values of a matrix and fix them to zero? Example: input: [[2,3,4],[3,4,5],[4,5,6]] output: [[0,3,4],[3,0,5],[4,5,0]] Thanks. -- View this message in context: http://old.nabble.com/How-to-fix-the-diagonal-values-of-a-matrix-tp27917991p27917991.html Sent from th

Re: [Numpy-discussion] Array mapping question

2010-03-16 Thread josef . pktd
On Tue, Mar 16, 2010 at 9:33 AM, Jorge Scandaliaris wrote: >   gmail.com> writes: > >> >> If I understand correctly, then you want return_inverse  (the original >> array recoded to using integers 0...len(ctab)-1 >> > >> Josef > > Right, thanks! I didn't see this cause I use numpy 1.3, where this i

Re: [Numpy-discussion] Array mapping question

2010-03-16 Thread Jorge Scandaliaris
gmail.com> writes: > > If I understand correctly, then you want return_inverse (the original > array recoded to using integers 0...len(ctab)-1 > > Josef Right, thanks! I didn't see this cause I use numpy 1.3, where this is not available. Jorge

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread josef . pktd
On Tue, Mar 16, 2010 at 8:47 AM, Sam Tygier wrote: > Hello > > I can't find much documentation for using arrays where the dtype has named > fields (is there a term for this sort of array). there is some in > http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html > http://docs.scipy.org/doc/

Re: [Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread Skipper Seabold
On Tue, Mar 16, 2010 at 8:47 AM, Sam Tygier wrote: > Hello > > I can't find much documentation for using arrays where the dtype has named > fields (is there a term for this sort of array). there is some in Structured array (or record array if you make a record array -- the difference is record a

Re: [Numpy-discussion] Array mapping question

2010-03-16 Thread josef . pktd
On Tue, Mar 16, 2010 at 8:00 AM, Jorge Scandaliaris wrote: > Hi, > I have a 1D array containing indexes to specific measurements. As this array > is > a slice of a bigger one, the indexes don't necessarily start at 0 nor they are > sequential. For example, I can have an array A where > > In [34]:

[Numpy-discussion] Documentation for dtypes with named fields

2010-03-16 Thread Sam Tygier
Hello I can't find much documentation for using arrays where the dtype has named fields (is there a term for this sort of array). there is some in http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html http://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.html but that's most crea

[Numpy-discussion] Array mapping question

2010-03-16 Thread Jorge Scandaliaris
Hi, I have a 1D array containing indexes to specific measurements. As this array is a slice of a bigger one, the indexes don't necessarily start at 0 nor they are sequential. For example, I can have an array A where In [34]: A.shape Out[34]: (4764,) In [35]: ctab = np.unique(A) In [36]: ctab Out[3

[Numpy-discussion] [ANN] EuroPython 2010 registration and talk submissions now open!

2010-03-16 Thread Ciarán Mooney
EuroPython 2010 - 17th to 24th July 2010 EuroPython is a conference for the Python programming language community, including the Django, Zope and Plone communities. It is aimed at everyone in the Python community, of all skill levels, both users and programm