[Numpy-discussion] numpy.fromstring() : error handling ?
Fri Aug 8 18:29:56 CDT 2008
> I am now disturbed by this result :
> > In : import numpy
> > In : numpy.fromstring("abcd", dtype = float, sep = ' ')
> > Out: array([ 0.])
> 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:
fromstring() needs some work in a few other ways -- see my message a
couple days ago.
Does anyone want to work on fromstring()? I'd like to , but my C skills
are weak, so I could use some help.
Christopher Barker, Ph.D.
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
More information about the Numpy-discussion