title: Apply CountVectorizer to column with list of words in rows in Python
body: <p>I made a preprocessing part for text analysis and after removing stopwords and stemming like this:</p>
  
  <pre><code>test[col] = test[col].apply(
      lambda x: [ps.stem(item) for item in re.findall(r"[\w']+", x) if ps.stem(item) not in stop_words])
  
  train[col] = train[col].apply(
      lambda x: [ps.stem(item) for item in re.findall(r"[\w']+", x) if ps.stem(item) not in stop_words])
  </code></pre>
  
  <p>I've got a column with list of "cleaned words". Here are 3 rows in a column:</p>
  
  <pre><code>['size']
  ['pcs', 'new', 'x', 'kraft', 'bubble', 'mailers', 'lined', 'bubble', 'wrap', 'protection', 'self', 'sealing', 'peelandseal', 'adhesive', 'keeps', 'contents', 'secure', 'tamper', 'proof', 'durable', 'lightweight', 'kraft', 'material', 'helps', 'save', 'postage', 'approved', 'ups', 'fedex', 'usps']
  ['brand', 'new', 'coach', 'bag', 'bought', 'rm', 'coach', 'outlet']
  </code></pre>
  
  <p><strong>I now want to apply CountVectorizer to this column</strong>:</p>
  
  <pre><code>from sklearn.feature_extraction.text import CountVectorizer
  cv = CountVectorizer(max_features=1500, analyzer='word', lowercase=False) # will leave only 1500 words
  X_train = cv.fit_transform(train[col])
  </code></pre>
  
  <p>But I got an Error: </p>
  
  <pre><code>TypeError: expected string or bytes-like object
  </code></pre>
  
  <p>It would be a bit strange to create string from list and than separate by CountVectorizer again.</p>