title: How to count comma seperated repeated values in a pandas column?
body: <p>I have a dataframe column like this:</p>
  
  <pre><code>1    Applied Learning, Literacy &amp; Language
  2             Literacy &amp; Language, Special Needs
  3            Math &amp; Science, Literacy &amp; Language
  4            Literacy &amp; Language, Math &amp; Science
  6               Math &amp; Science, Applied Learning
  7                               Applied Learning
  8                            Literacy &amp; Language
  10                                Math &amp; Science...
  </code></pre>
  
  <p>There are comma seperated values in each row. What I want is to count the occurance of all the unique values. For eg: Math &amp; Science appears 4 times. So the count for Math &amp; Science should be 4. I tried the following code:</p>
  
  <pre><code>cato=response['Category'].str.split(',')
  cat_set=[]
  for i in cato.dropna():
      cat_set.extend(i)
  plt1=pd.Series(cat_set).value_counts().sort_values(ascending=False).to_frame()
  </code></pre>
  
  <p>But the problem is, this code works for small datasets, but it takes a lot of time for a large dataset. Any solutions for this?</p>
  
  <p>Thanks</p>