title: CountVectorizer: AttributeError: 'numpy.ndarray' object has no attribute 'lower'
body: <p>I have a one-dimensional array with large strings in each of the elements. I am trying to use a <code>CountVectorizer</code> to convert text data into numerical vectors. However, I am getting an error saying:</p>
  
  <pre><code>AttributeError: 'numpy.ndarray' object has no attribute 'lower'
  </code></pre>
  
  <p><code>mealarray</code> contains large strings in each of the elements. There are 5000 such samples. I am trying to vectorize this as given below:</p>
  
  <pre><code>vectorizer = CountVectorizer(
      stop_words='english',
      ngram_range=(1, 1),  #ngram_range=(1, 1) is the default
      dtype='double',
  )
  data = vectorizer.fit_transform(mealarray)
  </code></pre>
  
  <p>The full stacktrace :</p>
  
  <pre><code>File "/Library/Python/2.7/site-packages/sklearn/feature_extraction/text.py", line 817, in fit_transform
      self.fixed_vocabulary_)
    File "/Library/Python/2.7/site-packages/sklearn/feature_extraction/text.py", line 748, in _count_vocab
      for feature in analyze(doc):
    File "/Library/Python/2.7/site-packages/sklearn/feature_extraction/text.py", line 234, in &lt;lambda&gt;
      tokenize(preprocess(self.decode(doc))), stop_words)
    File "/Library/Python/2.7/site-packages/sklearn/feature_extraction/text.py", line 200, in &lt;lambda&gt;
      return lambda x: strip_accents(x.lower())
  AttributeError: 'numpy.ndarray' object has no attribute 'lower'
  </code></pre>