[Numpy-discussion] Numpy structures
Fri Jun 8 05:31:19 CDT 2012
I am reading a datagram which contains within it a type. The type
dictates the structure of the datagram. I want to put this into a numpy
structure, one of which is:
As I don't know what I'm getting until I've read it (it seems I have to
read the whole datagram in one read) I don't know the shape of the
structure to use.
I have tried reading into:
and then attempting to copy to the correct structure. How should I do
this copy as numpy.copy() does not seem to work as if I then try to read
some fields in the structure it complains the fields don't exist.
Is there a better way to do this kind of thing, preferably without
causing a data copy?
More information about the NumPy-Discussion