On Wed, Jul 21, 2010 at 10:08 AM, Keith Goodman <kwgood...@gmail.com> wrote: > On Wed, Jul 21, 2010 at 9:56 AM, John Salvatier > <jsalv...@u.washington.edu> 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)] > else: > dar2 = dar[i]
My thoughts too.. it's dangerous to simply have a toggle that changes what darr.<slicingobject>[2] means. Much safer to have slicing options that always try to approach slicing with consistent rules. Separately, regarding the permissible axis labels, I think we must not allow any enumerated axis labels (ie, ints and floats). I don't remember if there was a consensus about that yesterday. We don't have the flexibility in the ndarray API to allow for the expression darr.method(axis=2) to mean not the 2nd dimension, but the Axis with label==2 Mike > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion