Indexing list of lists

John J. Lee jjl at pobox.com
Thu Sep 18 14:46:41 CEST 2003


hildegarde_roth at yahoo.de (Hilde Roth) writes:

> Thanks for the suggestion but zip is not nice for large lists
> and as for array/numpy, although I chose a numeric example in
> the posting, I don't see why only numeric arrays should enjoy
> the benefit of such a notation.

Numeric (and presumably numarray) can handle arbitrary Python objects.


> l[;0] is illegal right now but does anyone of any other bit
> of syntax it might conflict with if proposed as an extension?

BTW, just remembered that Numeric/numarray *does* use commas for
multi-dimensional indexing.  Apparently (glancing at the language ref)
that's not actually indexing with a tuple, but part of Python's
syntax.  Same goes for that other obscure bit of Python syntax, the
ellipsis, as used by Numeric: foo[a, ..., b].


John




More information about the Python-list mailing list