From: Pierre GM <pgmdevlist@gm...>  20061127 19:54:30

Teemu > Any ideas where the conflict might be coming from? When you type from MA import *, you overwrite the definition of 'array'. And surprisingly enough, a masked array in numpy.core.ma is an object independent of ndarray. Some functions such as swapaxes are not imported by MA (because they were not implemented for one reason or another): you then use the regular numpy function, which doesn't know how to deal with these 'masked arrays' objects. (I simplify a bit, here, but the gist is there) As you've noticed, the best solution is to use import MA That way, you leave the original numpy namespace alone, and are sure to use only "MAapproved" functions. But you'll likely gonna have to use MA.sqrt, MA.log all over your code. And may run into problems with functions that don't handle masked arrays. Still, it's the cleanest solution (the "from blah import *" tend to be frowned upon these days anyway). An alternative solution is to try the new implementation of masked arrays I've been working on: with this implementation, masked arrays are subclasses of regular arrays, which simplifies life a lot.The source file is available here: http://projects.scipy.org/scipy/numpy/wiki/MaskedArray Note the disclaimer: it's still a work in progress (even if I use it everyday and it works fine) and you'll have to modify a line in the matplotlib source to make it work OK with matplotlib, which is a bit tedious I agree. But it works. And it's actively maintained. Hope it helps P. 