mardi 6 janvier 2015

python simple if else structure wrong comparison

This is my code



for i,val in enumerate(DS3Y_pred_trans):
if val < 1.5:
DS3Y_pred_trans[i] = 1
else:
DS3Y_pred_trans[i] = 2


There are values less than 1.5 in the list, but the out is all 2s.


What am I missing?


Aucun commentaire:

Enregistrer un commentaire