Remove similar numbers in a list
<p>How do I remove numbers like 86.1 and 90.1 (or 86.2 and 90.2) from the following list?</p>

<pre><code>86.1      86.2       90.1      90.2
</code></pre>

<p>Try this:</p>

<pre><code>base = [86.1, 86.2, 90.1, 90.2]
# remove = [86.2, 90.2]
remove = [86.1, 90.1]

new_list = [item for item in base if item not in remove]
print(new_list)
</code></pre>

<p>In Stack Overflow post <em><a href="http://stackoverflow.com/questions/11434599/remove-list-from-list-in-python">Remove list from list in Python</a></em> you have more information.</p>

python list python-2.7