title: How to code in python this situation, combining two duplicate rows that have one cell different
body: <p>I need to code this situation by python with most performant way because My data is about 338 000 row.  </p>
  
  <p>I want to group my duplicated rows to get the following  result (table 2)</p>
  
  <p>ps : column SSS will be dropped and create n column that represents the total number of values that SSS contain   </p>
  
  <pre><code>aaa     bbb     ccc      SSS
  
  1       mmm     qq       S1
  1       mmm     qq       S4
  2       kkk     aa       S3
  3       bbb     ee       S1
  3       bbb     ee       S2
  3       bbb     ee       S4
  4       xxx     tt       S3
  </code></pre>
  
  <p>Result that i need to obtain </p>
  
  <pre><code>aaa     bbb     ccc      S1     S2    S3     S4
  
  1       mmm     qq       1      0      0      1
  2       kkk     aa       0      0      1      0
  3       bbb     ee       1      1      0      1 
  4       xxx     tt       0      0      1      0
  </code></pre>