Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Split a list based on a condition

good = [x for x in mylist if x in goodvals]
bad  = [x for x in mylist if x not in goodvals]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Split #list #based #condition
ADD COMMENT
Topic
Name
1+5 =