[SciPy-User] pylab

Pierre GM pgmdevlist at gmail.com
Mon Jul 19 20:05:07 EDT 2010


On Jul 19, 2010, at 7:59 PM, Benjamin Root wrote:
> 
> Yes, MaskedArrays are the preferred way to do this.  If you run into a situation where plotting MaskedArrays does not work, then that is a bug and should be reported.
> 
> Btw, I would avoid using None as an empty value.  NaNs might be better.

Indeed, Ben, indeed. A None in a list as input of numpy.ma.array will give your array a 'object' dtype, which will probably not be what you expect. 
numpy.nans are an option if you deal with floats, not if you deal with integers...
But keep in mind that whatever value you choose can be masked: check the masked_where function and similar, for example...


More information about the SciPy-User mailing list