DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
1+5 =
Submit