Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python select from list by boolean list

filtered_list = [i for (i, v) in zip(list_a, filter) if v] # filter is a list of booleans
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #select #list #boolean #list
ADD COMMENT
Topic
Name
1+5 =