[Numpy-discussion] numpy.fromstring() : error handling ?

oc-spam66 oc-spam66 at laposte.net
Fri Aug 8 21:11:41 EDT 2008


> > Shouldn't it raise an exception ValueError ? (because "abcd" is not a float)
> 
> I don't think so, but it shouldn't return a zero either.
> 
> That call should mean: scan this whitespace separated string for as many 
> floating point numbers as it has. There are none, so it should return 
> and empty array:

Is it really how it should be ? 

I thought this method should be restrictive in what it accepts (because the goal is to fill an array with precise dimensions). When floating point numbers are mixed with something else, it should be parsed with a regexp.



 Créez votre adresse électronique prenom.nom at laposte.net 
 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080809/9051d041/attachment.html>


More information about the NumPy-Discussion mailing list