Check if index is different in Python
<p>I have a set of arrays I'm getting from a postgres database. Something like:</p>

<pre><code>('2011-01-01','','sometext_in_field2',''.....)
('2011-01-01','','sometext_in_field2',''.....)
('2011-01-01','','','sometext_in_field3'.....)
</code></pre>

<p>I am writing to excel.
What I want to do is, when the index of the second field is found and it is bigger then the previous one, the row position should go to 0, so in excel I get:</p>

<pre><code>2011-01-01     sometext_in_field2  sometext_in_field3
2011-01-01     sometext_in_field2
</code></pre>
