title: python csv to json using column as key
body: <p>Please I need help, I don't want to print header from the CSV file.  </p>
  
  <pre><code>csvfile = open('testdata.csv', 'rU')
  jsonfile = open('brofile.json', 'w')
  
  fieldnames = {'Matric':[("studentName","dept","status")]}
  
  reader = csv.DictReader( csvfile, fieldnames)
  
  for row in reader:
      json.dump(row, jsonfile)
      jsonfile.write('\n')
  </code></pre>
  
  <p>The expected output </p>
  
  <pre><code>[2010CS01: { "Jones Doe", "Computer science", "paid"}]
  [2010CS02: {"James Rug", "Computer Science", "Paid"}]
  [2010AC01: {"Curtis Payne", "Accounting", "unpaid"}]
  </code></pre>
  
  <p>CSV file:</p>
  
  <pre><code>Matric         Name            Department            Status
  2010CS01       Jones Doe       Computer Science      Paid 
  2010CS02       James Rug       Computer Science      Paid 
  2010AC01       Curtis Payne    Accounting            Unpaid 
  </code></pre>