Re: list of indices

2006-07-24 Thread Tim Chase
>>indices=[0,3,6] >>new_list=list[indices] > new_list = [list[x] for x in indicies] and just as a caveat, it's generally considered bad form to shadow the built-in list as such... -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: list of indices

2006-07-24 Thread Chris Lambacher
On Mon, Jul 24, 2006 at 08:14:35AM -0700, Julien Ricard wrote: >hi, > >is there any method to get only some elements of a list from a list of >indices. Something like: > >indices=[0,3,6] >new_list=list[indices] new_list = [list[x] for x in indicies] > >which would cre