[SciPy-User] pylab

Joshua Holbrook josh.holbrook@gmail....
Tue Jul 20 11:27:28 CDT 2010


On Tue, Jul 20, 2010 at 8:17 AM,  <PHobson@geosyntec.com> wrote:
>> -----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
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>

Why not user your None as said junk value?

--Josh


More information about the SciPy-User mailing list