[Numpy-discussion] dtype confusion
Sun Mar 25 15:11:22 CDT 2007
Thanks Stefan and Travis for their explanations.
First a request: Could both explanations be added to the manual, please?
So the problem I was having was that I thought this difference in behavior
would be caused by two different types: recarray and ndarray.
I feel that there is still some underlying behavior that I don't understand,
but for now the puzzling thing was that I thought that the new dtype simply
assigns names and aliases varname[:,0] to varname['x'], varname[:,1] to
varname['y'], and so on. I didn't expect it to fundamentally change the
array in that way, I would have expected varname.view(recarray) to do that.
Would it make sense for me then to create something like a "namedarray"
subclass of ndarray that doesn't change the dtype but simply let's you
provide names and assign them to the columns? Maybe in my case it's easier,
because all columns of the record array have the same type
I guess I'll re-read the dtypes and recarray parts of the manual now...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion