On Nov 10, 2009, at 1:09 PM, Darryl Wallace wrote: > Hello again, > > The best way so far that's come to my attention is to use: > > numpy.ma.masked_object
Will only work for masking one specific string, as you've noticed. > > Can anyone help me so that all strings are found in the array without having > to explicitly loop through them in Python? This looks like it's working: >>> mask = (mixed >= '') >>> mixed = ma.array(np.where(~mask,mixed,np.nan),mask=mask,dtype=float) > Thanks, > Darryl > > > On Fri, Nov 6, 2009 at 3:56 PM, Darryl Wallace <darryl.wall...@prosensus.ca> > wrote: > What I'm doing is importing some data from excel and sometimes there are > strings in the worksheet. Now, what are you using to read the Excel file ? Do you get a list that you transform into an array, or an ndarray straightaway ? _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion