[SciPy-user] how to convert this matlab command to scipy?

Hoyt Koepke hoytak@gmail....
Fri May 16 01:38:53 CDT 2008

I have to say I haven't seen that particular operation in matlab
before.  Is mask a logical matrix or a matrix of indices?  If it's a
logical matrix, I really don't understand what it's trying to do.
If it's a matrix of indices, then you might get the same behavior in
numpy by using CYf[mask.ravel()] -- but I'm really not sure of this.
Normally, logical mask operations have to match shape exactly, and
index matrices are one dimensional....


On Thu, May 15, 2008 at 5:18 PM, zhang chi <zhangchipr@gmail.com> wrote:
> hi
>     How to convert this matlab command (Yf12(:) = CYf(mask);) to scipy
> command?
> where
> size(CYf) = (128 1)
> size(mask) = (128 128)
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user

Hoyt Koepke
UBC Department of Computer Science

More information about the SciPy-user mailing list