hey everyone,
i'm going to be comparing data in a list. Just basic >= or <= type stuff.
However, the list i have somtimes starts with 'n/a'. That is somtimes it starts like this:
data = ['1.0', '2.0', '1.5']
or
data = ['n/a', '1.0', '2.0', '1.5']
or
data = ['n/a', 'n/a', '1.0', '2.0', '1.5']
so i thought i could do something like this. so that I can start comparing actual numbers vs each other...
Should I just throw that bit in the code twice, back to back, in case i get a data list like the 3rd one (the oen w/ 2 n/a's) or does anyone have a more enlightened idea?
thanks
i'm going to be comparing data in a list. Just basic >= or <= type stuff.
However, the list i have somtimes starts with 'n/a'. That is somtimes it starts like this:
data = ['1.0', '2.0', '1.5']
or
data = ['n/a', '1.0', '2.0', '1.5']
or
data = ['n/a', 'n/a', '1.0', '2.0', '1.5']
so i thought i could do something like this. so that I can start comparing actual numbers vs each other...
Code:
>>> for i in x: ... if i == 'n/a': ... x.remove(i)
thanks
Comment