title: Python sort CSV File
body: <p>Hey I have a CSV file with many rows but one of the row constantly repeats. Is it possible to only keep the first name for that row and keep all other data. I tried with pandas but pandas asks for a function such as aggregate sum. My data in the CSV file is like.</p>
  
  <pre><code>H1 h2 h3 h4
  A 1 2 3 4
  A 2 3 4 5
  A 3 4 5 6
  B 1 2 3 4
  B 2 3 4 5
  B 3 4 5 6
  C 1 2 3 4
  C 2 3 4 5
  C 3 4 5 6
  </code></pre>
  
  <p>Each one of these has a header. Which are shown by h1-h4.
  My data is not like this, it contains real text values.</p>
  
  <p>I want to rearrange the data so it looks like this.</p>
  
  <pre><code>A 
     1 2 3 4
     2 3 4 5
     3 4 5 6
  B
     1 2 3 4
     2 3 4 5
     3 4 5 6
  
  C
     1 2 3 4
     2 3 4 5
     3 4 5 6
  </code></pre>
  
  <p>Or</p>
  
  <pre><code> A 1 2 3 4
     2 3 4 5
     3 4 5 6
  
  B  1 2 3 4
     2 3 4 5
     3 4 5 6
  
  C  1 2 3 4
     2 3 4 5
     3 4 5 6
  </code></pre>
  
  <p>So basically I want it to group by the first header name which is h1. Any help would be appreciated thanks.</p>