title: Count occurrences of each of certain words in pandas dataframe
body: <p>I want to count the number of occurrences of each of certain words in a data frame. I currently do it using <code>str.contains</code>:</p>
  <pre><code>a = df2[df2['col1'].str.contains(&quot;sample&quot;)].groupby('col2').size()
  n = a.apply(lambda x: 1).sum()
  </code></pre>
  <p>Is there a method to match regular expression and get the count of occurrences? In my case I have a large dataframe and I want to match around 100 strings.</p>