From: Andrew N. <aln...@st...> - 2003-05-13 06:25:09
|
On Tue, 13 May 2003, eric jones wrote: > Try fromstring. I think it should do what you want: > > >>> from Numeric import * print fromstring.__doc__ > > fromstring(string, typecode='l', count=-1) returns a new 1d array > initialized from the raw binary data in string. If count is > positive, the new array will have count elements, otherwise it's > size is determined by the size of string. Thanks, Eric. That did the trick. The manual said that Numeric.array() takes a sequence type as one of its arguments, and considering that a string is a sequence type, I thought that, given an appropriate typecode, it would do the conversion automatically in the same way that array.array does. Is this difference an intended feature of numpy? Andrew. |