Travis E. Oliphant <oliphant <at> enthought.com> writes: > I've been fairly quiet on this list for awhile due to work and family > schedule, but I think about how things can improve regularly. One > feature that's been requested by a few people is the ability to select > multiple fields from a structured array. > > Thus, suppose *arr* is a structured array with dtype: > > [('name', 'S25'), > ('height', float), > ('age', int), > ('gender', 'S8') > ] > > Then, newarr = arr[['name', 'age']] should be a structured array with > just the name and age fields. >
What are some common use cases for this feature? I use structured arrays quite a lot, but I haven't found myself wanting something like this. If I do need a subset of a structured array generally I use something like [rec[n] for n in 'name age gender'.split()] For me that use case doesn't come up very often though. _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion