On 7/6/06, Tim Hochberg <[EMAIL PROTECTED]> wrote:
> -) Being able to distinguish between row and column vectors; I guess
> this is just not possible with arrays...
>
Why can't you distinguish between them the same way that the matrix
class does? Shape [1, N] is a row array, shape [N,1] is column array.

Yep, that works.  But there are still various annoyances.  
- You have to remeber to specify extra brackets all the time.  Like array([[1,2,3]]) or array([[1],[2],[3]]). 
- And a slice of a vector out of a matrix has to be pumped back up to 2-D.   If x has ndim==2, then to get a column out of it you have to do x[:,i,None] instead of just x[:,i].  To get a row you need x[j,None] instead of just x[j]

Not horrible, but it feels a little klunky if you're used to something like Matlab.

So matrix gets rid of a few annoyances like that ... and replaces them with a few of its own.  :-)

--bb
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to