On 6/28/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
> On 6/28/06, Pau Gargallo <[EMAIL PROTECTED]> wrote:
> > i don't know why 'where' is returning matrices.
> > if you use:
> >
> > >>> idx = where(y.A > 0.5)[0]
> >
> > everything will work fine (I guess)
>
> What about the second issue? Is this expected behavior?
>
> >> idx
> array([0, 1, 2])
>
> >> y
>
> matrix([[ 0.63731308],
>        [ 0.34282663],
>        [ 0.53366791]])
>
> >> y[idx]
>
> matrix([[ 0.63731308],
>        [ 0.34282663],
>        [ 0.53366791]])
>
> >> y[idx,0]
> matrix([[ 0.63731308,  0.34282663,  0.53366791]])
>
> I was expecting a column vector.
>
I have never played with matrices, but if y was an array, y[idx,0]
will be an array of the same shape of idx. That is a 1d array.
I guess that when y is a matrix, this 1d array is converted to a
matrix and become a row vector.

I don't know if this behaviour is wanted :-(

cheers,
pau

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to