title: CountVectorizer with Pandas dataframe
body: <p>I am using scikit-learn for text processing, but my <code>CountVectorizer</code> isn't giving the output I expect.</p>
  
  <p>My CSV file looks like:</p>
  
  <pre><code>"Text";"label"
  "Here is sentence 1";"label1"
  "I am sentence two";"label2"
  ...
  </code></pre>
  
  <p>and so on.</p>
  
  <p>I want to use Bag-of-Words first in order to understand how SVM in python works:</p>
  
  <pre><code>import pandas as pd
  from sklearn import svm
  from sklearn.feature_extraction.text import CountVectorizer
  
  data = pd.read_csv(open('myfile.csv'),sep=';')
  
  target = data["label"]
  del data["label"]
  
  # Creating Bag of Words
  count_vect = CountVectorizer()
  X_train_counts = count_vect.fit_transform(data)
  X_train_counts.shape 
  count_vect.vocabulary_.get(u'algorithm')
  </code></pre>
  
  <p>But when I do <code>print(X_train_counts.shape)</code> I see the output is only <code>(1,1)</code>, whereas I have 1048 rows with sentences.</p>
  
  <p>What I am doing wrong? I am following <a href="http://scikit-learn.org/stable/tutorial/text_analytics/working_with_text_data.html" rel="noreferrer">this</a> tutorial.</p>
  
  <p>(Also the output of <code>count_vect.vocabulary_.get(u'algorithm')</code> is <code>None</code>.)</p>