I'm trying to create an And statement in my for loop. There is a data frame that I have under "b". There are two columns of the data frame that I isolated into their respective lists (cdr3_length and heavy_percent).
I'm trying to create a for loop where the it parses through b and adds all data where the cdr3_length > 15 and heavy_percent < 88 to a new list "candidates".
cdr3_length=marv["heavy_cdr3_aa_length"]
cdr3_length.head()
heavy_percent=marv["heavy_percent_id"]
heavy_percent.head()
cnt_=0
candidates=[]
for i in range(0, len(b)):
if (cdr3_length(b[i]) > 15 & heavy_percent(b[i]) < 88
candidates.append(b[i])
cnt_+=1
I am getting a syntax error in the if statement line, but I can't find it. I appreciate any hep given!
question from:https://stackoverflow.com/questions/65894384/using-columnar-data-in-for-loop