python select from list by boolean list code example
Example: 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
filtered_list = [i for (i, v) in zip(list_a, filter) if v] # filter is a list of booleans