Re: [Numpy-discussion] Automatic matrices

2006-12-21 Thread Keith Goodman
On 12/21/06, Sven Schreiber <[EMAIL PROTECTED]> wrote: > Keith Goodman schrieb: > > > How about diag? > > > > There was a thread about this (in which you participated, I believe); > for matrices you should now use m.diagonal() I think. So diag doesn't > qualify. I think the different results retur

Re: [Numpy-discussion] Automatic matrices

2006-12-21 Thread Sven Schreiber
Keith Goodman schrieb: > How about diag? > There was a thread about this (in which you participated, I believe); for matrices you should now use m.diagonal() I think. So diag doesn't qualify. -sven ___ Numpy-discussion mailing list Numpy-discussion@sc

Re: [Numpy-discussion] Automatic matrices

2006-12-21 Thread Keith Goodman
On 12/21/06, Sven Schreiber <[EMAIL PROTECTED]> wrote: > Sven Schreiber schrieb: > > Keith Goodman schrieb: > > > >> There are many numpy functions that will take a matrix as input but > >> return an array. > >> > >> The nan functions (nanmin, nanmax, nanargmin, nanargmax, nansum) are an > >> exam

Re: [Numpy-discussion] Automatic matrices

2006-12-21 Thread Sven Schreiber
Sven Schreiber schrieb: > Keith Goodman schrieb: > >> There are many numpy functions that will take a matrix as input but >> return an array. >> >> The nan functions (nanmin, nanmax, nanargmin, nanargmax, nansum) are an >> example. >> > > So that would be a bug IMHO and should be filed as a tick

Re: [Numpy-discussion] Automatic matrices

2006-12-16 Thread Charles R Harris
Testing, please disregard ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Automatic matrices

2006-12-16 Thread Sven Schreiber
Paulo Jose da Silva e Silva schrieb: > > Obs: I remember reading somewhere in the list that we can change the > behavior of numpy to make it return matrices as default, even in calls > for functions like zeros or ones. I don't have the reference now. Anyhow > I wanted a solution that can make any

Re: [Numpy-discussion] Automatic matrices

2006-12-16 Thread Sven Schreiber
Keith Goodman schrieb: > > There are many numpy functions that will take a matrix as input but > return an array. > > The nan functions (nanmin, nanmax, nanargmin, nanargmax, nansum) are an > example. > So that would be a bug IMHO and should be filed as a ticket. I will do that eventually if

Re: [Numpy-discussion] Automatic matrices

2006-12-15 Thread Robert Kern
Keith Goodman wrote: > But are there any unintended consequences of changing from array to > asanyarray? Not by itself, no. That entails that the implementations cannot rely on any particular behavior of the arrays. The correct(ish) approach looks something like the following, I believe: def f

Re: [Numpy-discussion] Automatic matrices

2006-12-15 Thread Keith Goodman
On 12/15/06, Paulo Jose da Silva e Silva <[EMAIL PROTECTED]> wrote: > I did not try to imply that there are some functions in numpy that > return array when receiving matrices. What I meant is that there are > functions in numpy that always return arrays. Hence they ask for an > explicit conversio

Re: [Numpy-discussion] Automatic matrices

2006-12-15 Thread Paulo Jose da Silva e Silva
Em Sex, 2006-12-15 às 23:37 +0100, Sven Schreiber escreveu: > Paulo Jose da Silva e Silva schrieb: > > > > > However, after trying to use the matrix class I have came across a major > > roadblock: many numpy/scipy functions return an array by default and not > > matrices. Then, we need then to ad

Re: [Numpy-discussion] Automatic matrices

2006-12-15 Thread Sven Schreiber
Paulo Jose da Silva e Silva schrieb: > > However, after trying to use the matrix class I have came across a major > roadblock: many numpy/scipy functions return an array by default and not > matrices. Then, we need then to add many conversion calls to the 'mat' > function in our code. This is als

[Numpy-discussion] Automatic matrices

2006-12-15 Thread Paulo Jose da Silva e Silva
Hello, If a numpy user is specially concerned with numerical linear algebra (or more generally with Math), it may find unconvenient the use of the dot function instead of the * operator. This behavior may be specially unpleasant for someone migrating from Matlab. I believe that this is the may re