title: How to solve Scikit learn preprocessing pipeline error with Numpy array?
body: <p>I am using scikit-learn to build a classifier that predicts if two sentences are paraphrases or not (e.g. paraphrases: How tall was Einstein vs. What was Albert Einstein's length).</p>
  
  <p>My data consists of 2 columns with strings (phrase pairs) and 1 target column with 0's and 1's (= no paraphrase, paraphrase). I want to try different algorithms. </p>
  
  <p>I expect the last line of code below to fit the model. Instead, the pre-processing Pipeline keeps producing an error I cannot solve: "AttributeError: 'numpy.ndarray' object has no attribute 'lower'."</p>
  
  <p>The code is below and I have isolated the error happening in the last line shown (for brevity I have excluded the rest). I suspect it is because the target column contains 0s and 1s, which cannot be turned lowercase.</p>
  
  <p>I have tried the answers to similar questions on stackoverflow, but no luck so far.</p>
  
  <p>How can you work around this?</p>
  
  <pre><code>question1               question2                        is_paraphrase
  How long was Einstein?  How tall was Albert Einstein?    1
  Does society place too  How do sports contribute to the  0
  much importance on      society?
  sports?                 
  What is a narcissistic  What is narcissistic personality 1  
  personality disorder?   disorder?
  </code></pre>
  
  <p>======</p>
  
  <pre><code>from sklearn.pipeline import Pipeline
  from sklearn.feature_extraction.text import CountVectorizer
  from sklearn.feature_extraction.text import TfidfTransformer
  from sklearn.naive_bayes import MultinomialNB
  from sklearn.model_selection import train_test_split
  import pandas as pd
  import numpy as np
  
  para = "paraphrases.tsv"
  
  df = pd.read_csv(para, usecols = [3, 5], nrows = 100, header=0, sep="\t")
  
  y = df["is_paraphrase"].values
  X = df.drop("is_paraphrase", axis=1).values
  X = X.astype(str) # I have tried this
  X = np.char.lower(X)
  
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.3, 
  random_state = 21, stratify = y)
  
  text_clf = Pipeline([('vect', CountVectorizer()),('tfidf', TfidfTransformer()), 
  ('clf', MultinomialNB())])
  
  text_clf.fit(X_train, y_train)
  </code></pre>