You change toYou're changing the value of the variable i -> The content of the array a does not change!
If you want to change the values in the array, you should rather implement it like this:
for index, value in enumerate(a):
try :
a[index] = float(value)
except ValueError :
pass