sorting by first group element in python
<p>I was wondering how can I make python order my collection of tuples so that first similar items would appear grouped and groups ordered by first item.</p>

<pre><code>order group
3     1
4     2
2     2
1     1
</code></pre>

<p>After sort</p>

<pre><code>order group
1     1
3     1
2     2
4     2
</code></pre>

<p>Python list</p>

<pre><code>unordered = [(3, 1), (4, 2), (2, 2), (1, 1)]
</code></pre>
