how to keep a partly duplicated sample

aileenzhou
aileenzhou New Altair Community Member
edited November 5 in Community Q&A
I have a dataset, there are some duplicated DOI. I must keep one of the duplicated DOIs based on 'source' attribute with preference: A>B>C, and delete rest.
For example, the data below, I want to keep row 1261 and 643, delete the rest. 

Row        DOI                      Source
18           10.1002/67           B
1261       10.1002/67           A
1400       10.1002/67           C
...
...
643        10.102/et.67         A
1428      10.102/et.67         C

Thank you in advance. 
Tagged:

Best Answer

Answers

  • aileenzhou
    aileenzhou New Altair Community Member
    @lionelderkrikor Thank you sooooo much. What if source 'B' is preferable records to keep?