title: Python columns match CSV
body: <p>I am trying to read in a csv file: <code>base_list.csv</code> - CSV file with two columns</p>
  
  <p>Then read in <code>file_1.csv</code> and remove and matching values from the <code>base_list.csv</code> file, and
  write those out to a new csv file called <code>Dups.csv</code></p>
  
  <p>When I run this I am getting the following error:</p>
  
  <blockquote>
    <p>emails = set(emails) #"set" removes duplicates in a list TypeError:
    unhashable type: 'list'</p>
  </blockquote>
  
  <p>Sample code below:</p>
  
  <pre><code>import csv
  #gather emails from base_list:
  with open("H:\\Python Backups\\DeDup\\ByCSV\\base_list.csv", "rU") as base_file:
      read_base_file = csv.reader(base_file, delimiter=",")
      duplicates_list = []
      rows = [row for row in read_base_file]
      for row in rows:
          duplicates_list.extend(row)
      #extract emails from other csv files (csv_files) from multiple
      #columns in those csv files (email_columns):
      emails = []
      with open("H:\\Python Backups\\DeDup\\ByCSV\\file_1.csv", "rU") as csvfile:
          read_csv = csv.reader(csvfile, delimiter=",")     
          email_rows = [r for r in read_csv]
          emails.extend(email_rows)
      #find duplicates from base_list and remove them:
      duplicates = [e for e in emails if e in duplicates_list]
      for dupe in duplicates:
          emails.remove(dupe)
      emails = set(emails) #"set" removes duplicates in a list
      #write the emails to a csv:
      writer = csv.writer(open("H:\\Python Backups\\DeDup\\ByCSV\\Dups.csv", "ab"))
      for email in zip(emails):
          writer.writerow(email)
  </code></pre>