[SciPy-user] Changes allow string -> number casting

Travis Oliphant oliphant.travis at ieee.org
Sat Dec 31 01:39:24 CST 2005


I just checked in to SVN, the changes needed to allow strings (and 
unicode) to be converted to numbers:

 >>> print array(['3.0','4','5','6']).astype(float)
array([ 3.,  4.,  5.,  6.])

It is not the fastest-possible approach (it goes through the Python int, 
long, float, and complex __new__ methods), but it works.

-Travis




More information about the SciPy-user mailing list