title: Convert CSV to JSON while dropping certain columns
body: <p>I downloaded a dataset from OECD on income inequality as a csv file. I want to only keep the data on: LOCATION, TIME, VALUE.</p>
  
  <p>This is what part of the head of the CSV looks like:</p>
  
  <pre><code>"LOCATION","INDICATOR","SUBJECT","MEASURE","FREQUENCY","TIME","Value","Flag Codes"
  "AUS","INCOMEINEQ","GINI","INEQ","A","2014",0.337,
  "AUS","INCOMEINEQ","GINI","INEQ","A","2016",0.33,
  "AUT","INCOMEINEQ","GINI","INEQ","A","2014",0.274,
  "AUT","INCOMEINEQ","GINI","INEQ","A","2015",0.276,
  "AUT","INCOMEINEQ","GINI","INEQ","A","2016",0.284,
  </code></pre>
  
  <p>This is my converter code so far:</p>
  
  <pre><code>#!/usr/bin/env python
  
  """Universal CSV to JSON converter with scalability options"""
  
  __author__      = "Tim Verlaan 11669128"
  
  import csv  
  import json  
  
  def convert():
      """Convert CSV file to JSON file"""
  
      # Open the CSV  
      f = open( 'data.csv')  
  
      # Change each fieldname to the appropriate field name.    
      reader = csv.DictReader( f, fieldnames = ( "LOCATION","INDICATOR","SUBJECT","MEASURE","FREQUENCY","TIME","Value","Flag Codes" ))  
  
      # skip the header 
      next(reader)
  
      # Parse the CSV into JSON  
      out = json.dumps( [ row for row in reader ] )  
  
      # Save the JSON  
      f = open( 'data_oecd.json', 'w')  
      f.write(out)  
  
  
  if __name__ == "__main__":
      """Separating the function, for scalability purposes"""
  
      convert()
  
  </code></pre>
  
  <p>Result now:</p>
  
  <p><code>[{"LOCATION": "AUS", "INDICATOR": "INCOMEINEQ", "SUBJECT": "GINI", "MEASURE": "INEQ", "FREQUENCY": "A", "TIME": "2014", "Value": "0.337", "Flag Codes": ""}, {"LOCATION": "AUS", "INDICATOR": "INCOMEINEQ", "SUBJECT": "GINI", "MEASURE": "INEQ", "FREQUENCY": "A", "TIME": "2016", "Value": "0.33", "Flag Codes": ""}, {"LOCATION": "AUT", "INDICATOR": "INCOMEINEQ", "SUBJECT": "GINI", "MEASURE": "INEQ", "FREQUENCY": "A", "TIME": "2014", "Value": "0.274", "Flag Codes": ""}, {"LOCATION": "AUT", "INDICATOR": "INCOMEINEQ", "SUBJECT": "GINI", "MEASURE": "INEQ", "FREQUENCY": "A", "TIME": "2015", "Value": "0.276", "Flag Codes": ""}, {"LOCATION": "AUT", "INDICATOR": "INCOMEINEQ", "SUBJECT": "GINI", "MEASURE": "INEQ", "FREQUENCY": "A", "TIME": "2016", "Value": "0.284", "Flag Codes": ""}</code></p>
  
  <p>Wanted result:</p>
  
  <pre><code>[{"LOCATION": "AUS", "TIME": 2014, "VALUE": 0.337}, {"LOCATION": "AUS", "TIME": 2016, "VALUE": 0.33}
  </code></pre>