[Numpy-discussion] list dtype?

Mark Wendell mark.wendell@gmail....
Sun Jul 19 11:22:08 CDT 2009

Is it possible to create a dtype that is a list of arbitrary length?

More specifically, let's say I have a custom dtype like this:
d = dtype( {'names':['index','xcoord','ycoord','weight'], 'formats': [
uint16, uint16, uint16, float ] } )

Now I'd like to create a 2D array where each entry is a LIST of items
of type d. Each list may contain only one instance, or many, and I
intend to write routines that will access and extend that list.

So I guess the more general question is... how do I create a dtype
that is a list, and can the length of that list vary from entry to
entry in a 2D array?

I hope I've explained this well enough. Thanks in advance.

Mark Wendell
"I guess songs are just interesting things to do with the air." Tom Waits

More information about the NumPy-Discussion mailing list