Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

I have a list like the following:

 {{1, 3}, {2, 5}, {3, 6}, {2, 4}}

I want the final list to be like that :

{{1, 3}, {2, 5}, {3, 6}}.

Here the first element of the sub list is needs to check with other sub list's first element and remove the sub list where first element repeated again.

So the final list doesn't have {2,4} because 2 is repeated twice.

share|improve this question
2  
look here, similar one + sorting: mathematica.stackexchange.com/questions/27274/… –  Kuba Jun 25 '13 at 9:04
    
@Mr.Wizard Why has my flag counter been reset??? –  Artes Jun 25 '13 at 22:08
    
@Artes Now that you mention it, I see that its totally gone from my profile page. –  Sjoerd C. de Vries Jun 25 '13 at 22:20
    
Closely related: mathematica.stackexchange.com/q/6279/121 –  Mr.Wizard Jun 25 '13 at 22:25
1  
@Artes The flagging system is undergoing some major overhaul (esp. in the backend... not sure how much of it we'd actually see). Some of those involve what flags actually reach the mods and what should be left to the community to decide (e.g. off-topic flags). So such counter resets might occur temporarily as they make changes. Don't worry, they're only temporary caching effects and not permanent (cc @Sjoerd) –  rm -rf Jun 26 '13 at 17:44
show 2 more comments

marked as duplicate by Simon Woods, Sjoerd C. de Vries, m_goldberg, Oleksandr R., Michael E2 Jun 25 '13 at 18:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 7 down vote accepted

You can use many functions, but the most straightforward approach uses DeleteDuplicates with a test function:

DeleteDuplicates[ {{1, 3}, {2, 5}, {3, 6}, {2, 4}}, First @ #1 == First @ #2 &]
{{1, 3}, {2, 5}, {3, 6}}
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.