On Nov 15, 2007 12:37 PM, sith . &lt;<a href="mailto:sith618@yahoo.com">sith618@yahoo.com</a>&gt; 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>&nbsp;&nbsp;&nbsp; print i<br>&nbsp;&nbsp;&nbsp; if i[1]&gt;i[0]:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;second index is larger&quot;<br>&nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;second index is smaller&quot;</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&#39;d like do is compare if 1.5 in i[1] is greater than 2 in i[0]; 
<br>for time series, t(1)&gt;t(0) and interate through the entire list - is 6 in i[2]&gt;than 1.5 in i[1] etc?<br>Since the data is in columns in a text file or csv, I can&#39;t&nbsp;put 1.5 in the same sublist as 2, and 6 in the same sublist as 
1.5 to make things easier.&nbsp; What can I do?&nbsp; <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>&nbsp; if a[i][1] &gt; a[i-1][1] :<br>&nbsp;&nbsp;&nbsp;&nbsp; print &#39;greater !!&#39; # or whatever you want<br clear="all"><br>-- <br>Aditya