[Numpy-discussion] Resize Method for Numpy Array

Sturla Molden sturla@molden...
Thu Sep 24 18:05:14 CDT 2009


Robert Kern skrev:
> collections.deque() is a linked list of 64-item chunks.
>   
Thanks for that useful information. :-) But it would not help much for a 
binary tree...

Since we are on the NumPy list... One could image making linked lists 
using NumPy  arrays with dtype=object. They are storage efficient like 
tuples, and mutable like lists.

def cons(a,b):
    return np.array((a,b),dtype=object)

But I guess the best way is to implement a real linked extension type in 
Cython.

S.M.


More information about the NumPy-Discussion mailing list