[SciPy-User] pylab

PHobson@Geosynte... PHobson@Geosynte...
Tue Jul 20 11:17:20 CDT 2010


> -----Original Message-----
> From: scipy-user-bounces@scipy.org [mailto:scipy-user-bounces@scipy.org]
> On Behalf Of Pierre GM
> Sent: Monday, July 19, 2010 5:05 PM
> To: SciPy Users List
> Subject: Re: [SciPy-User] pylab
> 
> 
> On Jul 19, 2010, at 7:59 PM, Benjamin Root wrote:
> > 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...

Ben and Pierre,

Thanks for the tips! Glad I chimed in here b/c I've definitely learned something. I'm often pulling data out from a database, so null records come back to me as None's. I'll be sure to set a CASE statement now that fills the NULLs in with an obviously junk value that I can mask from now on.

-paul



More information about the SciPy-User mailing list