[Numpy-discussion] Datarray BoF, part2
Wed Jul 21 13:41:01 CDT 2010
On Wed, Jul 21, 2010 at 11:08 AM, Keith Goodman <firstname.lastname@example.org> wrote:
> On Wed, Jul 21, 2010 at 9:56 AM, John Salvatier
> <email@example.com> wrote:
>> I don't really know much about this topic, but what about a flag at array
>> creation time (or whenever you define labels) that says whether valid
>> indexes will be treated as labels or indexes for that array?
> It's an interesting idea. My guess is that you'd end up having to
> check the attribute all the time when writing code:
> if dar.intaslabel:
> dar2 = dar[tickmap(i)]
> dar2 = dar[i]
Obviously there are several aspects of a labels that need to be
considered. An important on is if an operation breaks the meaning of
the labels. I like the idea of tickmap(i) it could have a lot of
features like grouping... Maybe even work on structure arrays(maybe).
The flag could connect the tickmap() to the array. Then if an
operation was performed on the array to would result in the labels no
longer being meaningful then the flag would change. In this way
tickmap(i) checks for the flags and each axis could have a flag.
(I am sure there is lots I am missing)
> NumPy-Discussion mailing list
More information about the NumPy-Discussion