Say I have the following CSV file;
1.41, 123456
1.42, 123456
1.43, 123456
and i want to find the "position"/location of a value in row 0 i.e. "1.41, 1.42, 1.43" in this case, depending on whether the particular row value is greater than or equal to an arbitrary inputted value.
So for example if the inputted value was 1.42, we would return position 0 and 1, or if the inputted value was 1.4, we would return 0, 1 and 2. Likewise, if the value was 1.45 we would not return any positions. Here is what i have:
out = open("test.csv","rU")
dataf=csv.reader(out, delimiter=',')
for row in dataf:
x = row[0]
for i in xrange(len(x)):
if x[i] >=1 :
print i
only to get,
0
1
2
3
0
1
2
3
0
1
2
3
so then i use
for i in xrange(len(x)):
if x[i] >=2 :
print i
But i still get the same position values. Can anyone steer me in the right direction?