On Nov 15, 2007 12:37 PM, sith . <<a href="mailto:sith618@yahoo.com">sith618@yahoo.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>a = [[1,2],[3,1.5],[5,6]]</div> <div>for i in a:<br> print i<br> if i[1]>i[0]:<br> print "second index is larger"<br> else:<br> print "second index is smaller"</div> <div>
[1, 2]</div> <div>second index is larger</div> <div>[3, 1.5]</div> <div>second index is small<br>er<br>[5, 6]</div> <div>second index is larger</div> <div><br>What I'd like do is compare if 1.5 in i[1] is greater than 2 in i[0];
<br>for time series, t(1)>t(0) and interate through the entire list - is 6 in i[2]>than 1.5 in i[1] etc?<br>Since the data is in columns in a text file or csv, I can't put 1.5 in the same sublist as 2, and 6 in the same sublist as
1.5 to make things easier. What can I do? <br>Thank you for your help.</div><div class="WgoR0d"><p>
</p><hr size="1"><br></div></blockquote></div><br>for i in range(1,len(a)) :<br> if a[i][1] > a[i-1][1] :<br> print 'greater !!' # or whatever you want<br clear="all"><br>-- <br>Aditya