title: Counting the Frequency of words in a pandas data frame
body: <p>I have a table like below:</p>
  
  <pre><code>      URN                   Firm_Name
  0  104472               R.X. Yah &amp; Co
  1  104873        Big Building Society
  2  109986          St James's Society
  3  114058  The Kensington Society Ltd
  4  113438      MMV Oil Associates Ltd
  </code></pre>
  
  <p>And I want to count the frequency of all the words within the Firm_Name column, to get an output like below:</p>
  
  <p><a href="https://i.stack.imgur.com/TbW0I.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TbW0I.png" alt="enter image description here"></a></p>
  
  <p>I have tried the following code:</p>
  
  <pre><code>import pandas as pd
  import nltk
  data = pd.read_csv("X:\Firm_Data.csv")
  top_N = 20
  word_dist = nltk.FreqDist(data['Firm_Name'])
  print('All frequencies')
  print('='*60)
  rslt=pd.DataFrame(word_dist.most_common(top_N),columns=['Word','Frequency'])
  
  print(rslt)
  print ('='*60)
  </code></pre>
  
  <p>However the following code does not produce a unique word count. </p>