title: How to count unique rows in a column based on multiple conditions in python
body: <p>I have a data frame that looks like that : (the treatment has multiple possibily of character variable, I just simplified for the question)</p>
  
  <pre><code>ID              Position            Treatment
  --20AxECvv-         0           A
  --20AxECvv-         -1          A
  --20AxECvv-         -2          A
  --h9INKewQf-        0           A
  --h9INKewQf-        -1          B
  zZU7a@8jN           0           B
  QUeSNEXmdB          0           C
  QUeSNEXmdB          -1          C
  qu72Ql@h79          0           C
  </code></pre>
  
  <p>I just want to keep the ID with exclusif treatment, in other word keep ID who was treated by only one treatment even if it was several times. After, I want to sum the number of ID for each treatment. The result would be :</p>
  
  <pre><code>ID              Position            Treatment
  --20AxECvv-         0           A
  --20AxECvv-         -1          A
  --20AxECvv-         -2          A
  zZU7a@8jN           0           B
  QUeSNEXmdB          0           C
  QUeSNEXmdB          -1          C   
  qu72Ql@h79          0           C
  </code></pre>
  
  <p>And the sum :</p>
  
  <pre><code>A : 1 
  B : 1
  C : 2
  </code></pre>
  
  <p>I have any ida how to resolve this, maybe with a loop within a loop but I am a beginner with Python/panda Thanks</p>