title: Export filters csv data to a new csv (python)
body: <p>I would like to be able to read a csv file, filter out the data that I need based on the input of a user and then take that output and write it to a new CSV file.</p>
  <p>A manual example would be to take a table in excel,  filter specific columns to a certain value and take that filtered output and move it to a new file so you only have the filtered data.</p>
  <p>I have a csv file that I am reading in</p>
  <pre><code>    reader = csv.reader(data, delimiter= ',')```
  
  I am then asking a user for input
  
  ```object1 = input('What is the first thing you need?)```
  ```object2 = input('What what is the second thing you need?')```
  
  ```def objs():
              values = ''
              for row in reader:
                  if row[3] == object1 and row[14] == object2: 
                      values = row[0], row[1], row[3], row[7], row[14]
                      print(values)
              return values```
  
  
  When I print the output of def objs I get exactly what I am looking for. However it is all one line and not separated by columns. 
  
  How can I take this output and move it to a new .csv file with headers and so each indexed row has its own column?
    
   
  </code></pre>