title: to extract specific columns from a csv file and copy it to another using python
body: <p>I have a CSV file which is actually a matrix of 0's and 1's.  I need to exclude those columns that have 0's and pick only those that have 1's and copy them to another CSV file.</p>
  
  <p>Here is what I have tried:</p>
  
  <pre><code>    reader=csv.DictReader(open("test1.csv","r"),[])
  
  for data in reader:
          if data==1:
                  print data
  </code></pre>
  
  <p>What am I doing wrong?</p>