Q:

How to visualize the size of a word depending on its value

I don't know if this is possible, or how to even approach this, but is there a way to do the follow? 
I have a df that looks like this:
          0                                1
5  0.968470                              car
0  0.014322                            adult
4  0.013177                            child
6  0.001174                          mailbox
7  0.001163                        lightpost
1  0.001144                          bicycle
3  0.000200                         stopsign
2  0.000184                     trafficlight
8  0.000165                              dog

It is the probability distribution output of a classification problem.  I want to print out the words (column[0]), but have the font size reflect the probability value (column[1[) for that row.  Kind of like a word cloud, which prints words in bigger font when they have higher frequency. 
Any ideas on how to approach this? 

A:

The wordcloud has an option generate_from_frequencies which uses a dictionary with relative frequencies.  The parameter prefer_horizontal=1 can be used to force only horizontal words (default is 0.9: about 10% vertical words). 
from wordcloud import WordCloud
from matplotlib import pyplot as plt

d = {w: f for w, f in
     zip(['car', 'adult', 'child', 'mailbox', 'lightpost', 'bicycle', 'stopsign', 'trafficlight', 'dog'],
         [0.968470, 0.014322, 0.013177, 0.001174, 0.001163, 0.001144, 0.000200, 0.000184, 0.000165])}
wordcloud = WordCloud(background_color='turquoise', colormap='inferno', prefer_horizontal=1)
wordcloud.generate_from_frequencies(frequencies=d)
plt.imshow(wordcloud)
plt.axis('off')
plt.show()

