[Numpy-discussion] Double-ended queues

William Furnass will at thearete.co.uk
Tue Sep 25 05:03:59 EDT 2012

Hi all,

I want to be able to within a loop a) apply a mathematical operation
to all elements in a vector (can be done atomically) then b) pop zero
or more elements from one end of the vector and c) push zero or more
elements on to the other end.  So far I've used a collections.deque to
store my vector as it should be more efficient than a numpy array for
the appending and deletion of elements.  However, I was wondering
whether performance could be improved through the use of a
homogeneously-typed double-ended queue i.e. a linked list equivalent
of numpy.ndarray.  Has anyone previously considered whether it would
be worth including such a thing within the numpy package?



More information about the NumPy-Discussion mailing list