[Numpy-discussion] Adding the ability to "clone" a few fields from a data-type
Travis E. Oliphant
oliphant@enthought....
Wed Oct 29 19:05:50 CDT 2008
Hi all,
I'd like to add to NumPy the ability to clone a data-type object so that
only a view fields are copied over but that it retains the same total size.
This would allow, for example, the ability to "select out a few records"
from a structured array using
subarr = arr.view(cloned_dtype)
Right now, it is hard to do this because you have to at least add a
"dummy" field at the end. A simple method on the dtype class
(fromfields or something) would be easy to add.
It was thought in the past to do this with indexing
arr['field1', 'field2']
And that would still be possible (and mostly implemented) if this
feature is added.
Thoughts?
-Travis
More information about the Numpy-discussion
mailing list