title: Generate a word cloud to show frequenices of numbers in Python
body: <p>I have a pandas dataframe which consists of grade points of students. I want to generate the word cloud or number cloud for the grades. Is there any way to achieve it. I tried all possible ways but all my efforts in vain. Basically what I want is word cloud that contains numbers in it. from the column CGPA.</p>
  
  <p>Here is what I tried : </p>
  
  <pre><code>import pandas as pd
  from wordcloud import WordCloud
  import matplotlib.pyplot as plt
  df = pd.read_csv("VTU_marks.csv")
  # rounding off
  df = df[df['CGPA'].isnull() == False]
  df['CGPA'] = df['CGPA'].round(decimals=2)
  
  wordcloud = WordCloud(max_font_size=50,max_words=100,background_color="white").generate(string)
  plt.figure()
  plt.imshow(wordcloud, interpolation="bilinear")
  plt.axis("off")
  plt.show()
  </code></pre>
  
  <p>But I am getting an error</p>
  
  <pre><code>---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-47-29ec36ebbb1e&gt; in &lt;module&gt;()
  ----&gt; 1 wordcloud = WordCloud(max_font_size=50, max_words=100, background_color="white").generate(string)
        2 plt.figure()
        3 plt.imshow(wordcloud, interpolation="bilinear")
        4 plt.axis("off")
        5 plt.show()
  
  /usr/local/lib/python3.6/dist-packages/wordcloud/wordcloud.py in generate(self, text)
      603         self
      604         """
  --&gt; 605         return self.generate_from_text(text)
      606 
      607     def _check_generated(self):
  
  /usr/local/lib/python3.6/dist-packages/wordcloud/wordcloud.py in generate_from_text(self, text)
      585         """
      586         words = self.process_text(text)
  --&gt; 587         self.generate_from_frequencies(words)
      588         return self
      589 
  
  /usr/local/lib/python3.6/dist-packages/wordcloud/wordcloud.py in generate_from_frequencies(self, frequencies, max_font_size)
      381         if len(frequencies) &lt;= 0:
      382             raise ValueError("We need at least 1 word to plot a word cloud, "
  --&gt; 383                              "got %d." % len(frequencies))
      384         frequencies = frequencies[:self.max_words]
      385 
  
  ValueError: We need at least 1 word to plot a word cloud, got 0.
  </code></pre>
  
  <p>You can find the data <a href="https://drive.google.com/open?id=1p4piT4obqRFe31I3ms0NYKg1knJgeIZA" rel="nofollow noreferrer">here</a>.</p>