Search for duplicates inside an array : <p>I am trying to find duplicates inside an array. 
my array looks like: </p>

<pre><code>['LM_Auto', 'LM_Auto', 'LM_Op', 'LM_Op'] 
</code></pre>

<p>and much longer with a few thousand of these pairs. </p>

<pre><code>def clear_stemmed_LM(collection): 
i = 0
ele = i+1
for i in collection:
    for ele in collection:
        if i == ele:
            del collection[ele]
return collection 
</code></pre>

<p>the error says the list indices must be integers or slices not strings. How can I compare strings in an array? </p>

<pre><code>[if x+1 for in x range] #Idea
</code></pre>

<p>or something similar like this?  </p>
