[Numpy-discussion] fromstring, tostring slow?
Tue Feb 13 15:24:09 CST 2007
Yup. It was faster to:
Use lists for the append, then transform into an array, then transform
into a binary string
Create empty arrays and use its append method, then transform into a
The last question on the output when then be to test the speed of using
generic Python arrays, which have append methods as well. Then, there
would still only be the binary string conversion as apposed to
list-->numpy array-->binary string
Thanks to all for your input....
[mailto:email@example.com] On Behalf Of Charles R
Sent: Tuesday, February 13, 2007 12:44 PM
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] fromstring, tostring slow?
I am going to guess that a list would be faster for appending. Concat
and, I suspect, append make new arrays for each use, rather like string
concatenation in Python. A list, on the other hand, is no doubt
optimized for adding new values. Another option might be using PyTables
with extensible arrays. In any case, a bit of timing should show the way
if the performance is that crucial to your application.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion