To separate only the lists that converted become all numbers, I do it like this:
a = ['start','nan','1.004569','0.8554','nan']
b = ['0.464','5','4.8784','2.411474','0.44']
c = ['start','start','start','start','nan']
full_list = [a,b,c]
for test in full_list:
try:
numbers = [float(i) if '.' in i or 'e' in i else int(i) for i in test]
print(numbers)
print(sum(numbers))
except:
pass
output:
[0.464, 5, 4.8784, 2.411474, 0.44]
13.193874000000001
But it seems archaic and unprofessional to use try except
in these cases. How should I do this without having to find errors to separate the correct lists and use the numbers later?