title: How to generate word cloud from CSV file with word frequencies
body: <p>I have a CSV file with data in the following format</p>
  
  <pre><code>column1 column2
  hello     1
  film      9
  chicken   20
  etc       etc
  </code></pre>
  
  <p>How can I generate a word cloud using such a file with python? I tried using the wordcloud package by Andreas Mueller but it doesn't accept csv. I also tried using the generate_from_frequencies option as such</p>
  
  <pre><code>reader = csv.reader(open('wordcount.csv', 'r',newline='\n'))
  d = {}
  
  for k,v in reader:
      d[k] = v
  
   # Generate a word cloud image
   wordcloud = WordCloud().generate_from_frequencies(d) 
  </code></pre>
  
  <p>But kept getting an error as below. </p>
  
  <pre><code>File "wordcloudtest.py", line 22, in &lt;module&gt;
      wordcloud = WordCloud().generate_from_frequencies(d)
    File "C:\Users\Lenovo\Anaconda3\lib\site-packages\wordcloud\wordcloud.py", line 360, in generate_from_frequenci
      for word, freq in frequencies]
    File "C:\Users\Lenovo\Anaconda3\lib\site-packages\wordcloud\wordcloud.py", line 360, in &lt;listcomp&gt;
      for word, freq in frequencies]
  TypeError: unsupported operand type(s) for /: 'str' and 'float'
  </code></pre>