problems with duplicating and slicing an array
beliavsky at aol.com
beliavsky at aol.com
Fri Jan 21 11:41:51 EST 2005
More information about the Python-list mailing list
Fri Jan 21 11:41:51 EST 2005
- Previous message (by thread): problems with duplicating and slicing an array
- Next message (by thread): problems with duplicating and slicing an array
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Yun Mao wrote: >Thanks for the help. numarray doesn't provide what I look for either. e.g. >a = array( [[1,2,3],[4,5,6]] ) >I sometimes what this: a[ [1,0], :], or even >a[ [1,0], [0,1] ] , which should give me >[[4, 5], [1,2]] I think Fortran 90 and 95 have the array slicing you want. For example, if imat = 11 12 13 21 22 23 then imat([2,1,2],:)) = 21 22 23 11 12 13 21 22 23 and imat([2,1,2],[1,3]) = 21 23 11 13 21 23 Like Matlab, Fortran arrays by default start with 1, and x(i:j) gives a slice of elements including x(j). There are free compilers g95 (in beta) and gfortran (in alpha).
- Previous message (by thread): problems with duplicating and slicing an array
- Next message (by thread): problems with duplicating and slicing an array
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list