def remove_sel(l1, l2):
return [z1 for z1, z2 in zip(l1, l2) if z2>=0]
works nicely to remove negatives values of a list but if my list is z=[1, 2, 3, 'NAN']
Ps I wonder if my list is z
or z'=['1','2', '3','NAN']
I have tried
math import isnan
zz = [x for x in z if not isnan(x)]