title: XGBoost Python error: "Size of labels must equal to number of rows"
body: <p>I am using xgboost in Python.</p>
  <pre><code>import pandas as pd
  import numpy as np
  import xgboost as xgb
  from sklearn.model_selection import train_test_split
  
  df=pd.read_csv('442.csv')
  y=df.columnone
  X=df.columnfive
  
  X_train,X_test,Y_train,Y_test=train_test_split(X,y,test_size=0.2)
  dtrain = xgb.DMatrix(X_train, label=Y_train)
  dtest = xgb.DMatrix(X_test, label=Y_test)
  </code></pre>
  <p>The shape of the label seem to be uniform with the training set?</p>
  <pre><code>X_train.shape
  &gt;(405020,)
  Y_train.shape
  &gt;(405020,)
  
  param = {
     'eta': 0.3,
     'max_depth': 3, 
     'objective': 'multi:softprob', 
     'num_class': 2}
  steps = 20  # The number of training iterations
  </code></pre>
  <p>But running this gives me this result:</p>
  <pre><code>model = xgb.train(param, dtrain, steps)
  &gt;XGBoostError: Check failed: labels_.Size() == num_row_ (405020 vs. 1) : Size of labels must equal to number of rows.
  </code></pre>
  <p>When I run</p>
  <pre><code>dtrain.num_row()
  &gt;1
  dtrain.num_col()
  &gt;405020
  </code></pre>
  <p>This might have to do with the error? But I still have no idea how that could have happened. My initial X and y variables both have the correct number of rows and one column each.</p>