title: Use 2 column for training data in machine learning
body: <p>I have a dataframe named <code>ds</code> with 3 column of data as follows</p>
  <pre><code>         text     count      label
  0   I have...        12        pos   
  1   You sh...         8        neg
  2   In thi...         9        neg
  .
  .
  </code></pre>
  <p>I was given an example by using only <code>text</code> for creating test and training data with code like</p>
  <pre><code>X = ds['text']
  y = ds['label']
  train_X, test_X, train_Y, test_Y = train_test_split(X, y, test_size=0.25, random_state=0)
  
  df_train75 = pd.DataFrame()
  df_train75['text'] = train_X
  df_train75['label'] = train_Y
  
  df_test25 = pd.DataFrame()
  df_test25['text'] = test_X
  df_test25['label'] = test_Y
  
  from sklearn.feature_extraction.text import TfidfVectorizer
  
  tfidf_vect_7525 = TfidfVectorizer(ngram_range = (1, 1))
  tfidf_vect_7525.fit(ds['text'])
  train_X_tfidf_7525 = tfidf_vect_7525.transform(df_train75['text'])
  test_X_tfidf_7525 = tfidf_vect_7525.transform(df_test25['text'])
  
  from sklearn.svm import SVC
  
  model = SVC(kernel='linear')
  model.fit(train_X_tfidf_7525,train_Y)
  </code></pre>
  <p>==================================================================================</p>
  <p>I tried to include <code>text</code> and <code>count</code> column by simply changing the first line with</p>
  <pre><code>X = ds[['text', 'count']
  </code></pre>
  <p>And it gives me error on</p>
  <pre><code>from sklearn.svm import SVC
  
  model = SVC(kernel='linear')
  model.fit(train_X_tfidf_9010,train_Y)
  </code></pre>
  <p>==================================================================================</p>
  <p>My question is, how should I approach this problem? I tried to look into other question but failed to have an answer. One &quot;solution&quot; I found is by using</p>
  <pre><code>X = ds['text'].astype(str) + ' ' + ds['count'].astype(str)
  </code></pre>
  <p>but I don't think it was the correct option to approach this problem.
  Thank you in advance!</p>