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]
which would create a new list containing 0th, 3rd and 6th elements from the original list? I do this with a loop but I'd like to know if there is a simpler way.
thanks in advance
Jul
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]
which would create a new list containing 0th, 3rd and 6th elements from the original list? I do this with a loop but I'd like to know if there is a simpler way.
thanks in advance
Jul
-- http://mail.python.org/mailman/listinfo/python-list