Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python remove many items via index at oncefrom a list?

reduced_list = [elem for elem in my_list if my_list.index(elem) in indexes_to_keep_list]
 
PREVIOUS NEXT
Tagged: #python #remove #items #index #oncefrom
ADD COMMENT
Topic
Name
9+4 =