Pandas: create word cloud from a column with strings
<p>I have a following <code>dataframe</code> with <code>string</code> values:</p>

<pre><code>  text
0 match of the day
1 euro 2016
2 wimbledon
3 euro 2016
</code></pre>

<p>How can I create a <code>word cloud</code> from this column?</p>

<p>I think you need <a href="http://stackoverflow.com/a/39172275/2901002">tuple of tuples</a> with frequencies, so use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.value_counts.html" rel="nofollow"><code>value_counts</code></a> with <code>list comprehension</code>:</p>

<pre><code>tuples = tuple([tuple(x) for x in df.text.value_counts().reset_index().values])
print (tuples)
(('euro 2016', 2), ('wimbledon', 1), ('match of the day', 1))

#http://stackoverflow.com/q/38247648/2901002
cloud.generate_from_frequencies(tuples)
</code></pre>

python string python-2.7 pandas word-cloud