vector subscripts in Python?

Mike Rovner mike at bindkey.com
Thu Jun 12 01:31:29 CEST 2003


<beliavsky at aol.com> wrote in message
> Does Python have the equivalent of "vector subscripts" of Fortran 95?

Not directly.

> ii = [0,2]
> xx = [1,4,9]
> print subscript(xx,ii) # returns [1, 9]; in F95, "print*,xx(ii)" is
analogous

print [x[i] for i in ii]

WBR,
Mike








More information about the Python-list mailing list