title: Unfolding bag of words in pandas column (python)
body: <p>In pandas I am trying to unfold a bag of words from the words that appear in col2. My main aim is to find all the unique words and their frequency in each different category. If a word appears twice in a category, that will count as 1 (for example "msk" and "people").</p>
  
  <p>For example - 
  I have a pandas column that looks like this : </p>
  
  <pre><code>col1        col2
  Software    [msk , people , inc. ]
  Software    [logical , corp , ltd ] 
  Software    [imt , datalink , services. ]
  Hardware    [peoples , avenue , management ] 
  Hardware    [msk , techn ]
  Transport   [tata , mgm , workspace , ltd ] 
  Services    [msk , people , inc. ]
  Services    [happy , people , party , new ] 
  </code></pre>
  
  <p>My output should look something like this</p>
  
  <pre><code>words       category-freq .                          
  msk          3
  people       2
  inc.         2 
  logical      1
  corp         1
  ltd          2
  </code></pre>
  
  <p>etc. ( This is just an example I'm giving and have omitted some rows towards the end)</p>
  
  <p>The bag of words in column 2 are in the form of a list.</p>