Slicing / subsetting list in arbitrary fashion

2006-11-17 Thread Gregg Lind
One difficulty I am having with using Python for scientific computing is that I cannot figure out good ways to get arbitrary (unpatterned?) slices. As an example, in R or Matlab / Octave, syntax exists such that: vals = range(6) wanted = [1,2,3,1,1,1] vals[wanted] = [1,2,3,1,1,1] Both of those

Slicing / subsetting list in arbitrary fashion

2006-11-17 Thread Gregg Lind
I wish something like this was part of the standard python installation, and didn't require one to use Numpy or Numarray. This sort of list subsetting is useful in many, many contexts. -- http://mail.python.org/mailman/listinfo/python-list