Remove duplicate data from an array in python <p>I have this array of data</p> <pre><code>data = [20001202.05, 20001202.05, 20001202.50, 20001215.75, 20021215.75] </code></pre> <p>I remove the duplicate data with <code>list(set(data))</code>, which gives me </p> <pre><code>data = [20001202.05, 20001202.50, 20001215.75, 20021215.75] </code></pre> <p>But I would like to remove the duplicate data, based on the numbers before the "period"; for instance, if there is <code>20001202.05</code> and <code>20001202.50</code>, I want to keep one of them in my array.</p>