import numpy as np
a = ['','','',1.1,2.2]
mask_a = [i == '' for i in a]
b = np.ma.MaskedArray(a, mask=mask_a)



Chris Withers wrote:
> Eric Firing wrote:
>   
>> Chris,
>>
>> Use masked arrays.  See masked_demo.py in the mpl examples subdirectory.
>>     
>
> Hi Eric,
>
> I took a look at that, but it uses:
>
> import matplotlib.numerix.npyma as ma
>
> ...and matplotlib.numerix isn't listed in the API reference. Where are 
> the docs for this?
>
> Specifically, what I have is an array like so:
>
> ['','','',1.1,2.2]
>
> I want to mask the strings out so I don't get ValueErrors raised when I 
> call plot functions with that array.
>
> How should I do that?
>
> cheers,
>
> Chris
>
>   


-- 
[EMAIL PROTECTED]
http://www.cafelamarck.it



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to