Try using astype. This works:

values = array(wavearray.split()).astype(float)

Gary R.

Adam Mercer wrote:
> values = array(wavearray.split())
> 
> where wavearray is a string containing a series of floats separated by
> white space, it appears that the individual elements of the values
> array are strings, where I need them to be floats.  How can I ensure
> that the individual elements of the values array are floats, not
> strings?
> 
> I have tried using
> 
> values = array(wavearray.split(), dtype=float)
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to