title: How to find the frequency of words in a list created from a .csv file
body: <p>I am trying to write a program that first reads in the name of an input file and then reads the file using the csv.reader() method. The file contains a list of words separated by commas. The program should output the words and their frequencies (the number of times each word appears in the file) without any duplicates.</p>
  <p>The file <em>input1.csv</em> has <strong>hello,cat,man,hey,dog,boy,Hello,man,cat,woman,dog,Cat,hey,boy</strong></p>
  <p>So far I have this:</p>
  <pre><code>import csv
  with open('input1.csv', 'r') as wordsfile:
  words_reader = csv.reader(wordsfile)
  for row in words_reader:
      for word in row:
          count = row.count(word)
          print(word, count)
  </code></pre>
  <p>But my output is this:
  &quot;hello 1
  cat 2
  man 2
  hey 2
  dog 2
  boy 2
  Hello 1
  man 2
  cat 2
  woman 1
  dog 2
  Cat 1
  hey 2
  boy 2&quot;</p>
  <p>I am trying to output this but without any duplicates, I'm stumped and any help would be appreciated.</p>