[Numpy-discussion] Numpy Array of dtype=object with strings and floats question
Tue Nov 10 13:23:32 CST 2009
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:
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)
> On Fri, Nov 6, 2009 at 3:56 PM, Darryl Wallace <email@example.com> 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 ?
More information about the NumPy-Discussion