Separate a list based on values in a second list
list(itertools.compress(X, Y)) will get you the list of good lists. list(itertools.compress(X, [not a for a in Y])) will get you the list of bad lists.
X: a list of lists, where each list element corresponds to a label in Y
Y: a binary list of labels (values are either 1 or 0)
I want to extract the elements in X according to the value at the corresponding index in Y, as follows:
good = values of X where the label/value in Y is 1
bad = values of X where the label/value in Y is 0
I am still fairly new to sub-setting in Python and not really sure of a good way to do this.