title: how to count number of words for each column which is in array structure in Pandas
body: <p>I have the string column in my dataframe, where I have split the sentences into words. Now I need to calculate the occurrence of that word and converting them to columns. Basically creating a document term matrix</p>
  
  <pre><code>0                   [kubernetes, client, bootstrapping, ponda]
  1                                                [micro, insu]
  2                                                 [motor, upi]
  3                                  [secure, app, installation]
  4                    [health, insu, express, credit, customer]
  5                                  [secure, app, installation]
  6                                                 [aap, insta]
  7                               [loan, house, loan, customers]
  </code></pre>
  
  <p>Output :</p>
  
  <pre><code>    kubernetes  client  bootstrapping   ponda   loan    customers   installation
  0        1       1      1               1       0           0        0
  1        0       0      0               0       1           0        1
  2        0       2      0               0       0           0        0
  3        1       1      1               1       0           0        0
  </code></pre>
  
  <p>Code so far</p>
  
  <pre><code> from sklearn.feature_extraction.text import CountVectorizer
  
   countvec = CountVectorizer()
  
   countvec.fit_transform(df.new)
  </code></pre>
  
  <p>Error :</p>
  
  <blockquote>
    <p>AttributeError: 'list' object has no attribute 'lower'</p>
  </blockquote>