 <p>If you have access to the OrderedDict (in Python 2.7 on), abusing it a good way to do this:</p> <pre><code>import collections import pprint a = [[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0], [3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 5.0, 5.0, 5.0], [1.0, 4.0, 4.0, 4.0, 5.0, 5.0, 5.0], [5.0, 5.0, 5.0], [1.0] ] b = [list(collections.OrderedDict.fromkeys(i)) for i in a] pprint.pprint(b, width = 40) </code></pre> <p>Outputs:</p> <pre><code>[[1.0], [2.0, 3.0, 4.0], [3.0, 5.0], [1.0, 4.0, 5.0], [5.0], [1.0]] </code></pre>