title: Getting error as DataFrame.dtypes for data must be int, float, bool or categorical
body: <p>Full error in   XGBOOST is</p>
  <pre><code>ValueError: DataFrame.dtypes for data must be int, float, bool or categorical.  When
                  categorical type is supplied, DMatrix parameter
                  `enable_categorical` must be set to `True`.Year
  </code></pre>
  <p>The data is</p>
  <pre><code>&lt;class 'pandas.core.frame.DataFrame'&gt;
  Int64Index: 50327 entries, 0 to 50326
  Data columns (total 4 columns):
   #   Column  Non-Null Count  Dtype         
  ---  ------  --------------  -----         
   0   C_Id    50327 non-null  int8          
   1   Year    50327 non-null  datetime64[ns]
   2   value   50327 non-null  float64       
   3   R_Id    50327 non-null  int8          
  dtypes: datetime64[ns](1), float64(1), int8(2)
  memory usage: 2.3 MB
  </code></pre>
  <p>Then I did,</p>
  <pre><code>t_date = &quot;2019-01-01 00:00:00&quot;
  X_train = data[data[&quot;Year&quot;]&lt;t_date].drop([&quot;value&quot;],axis=1)
  Y_train = data[data[&quot;Year&quot;]&lt;t_date][&quot;value&quot;]
  X_test = data[data[&quot;Year&quot;]&gt;=t_date].drop([&quot;value&quot;],axis=1)
  </code></pre>
  <p>`</p>
  <pre><code>model = XGBRegressor(
      max_depth = 8,n_estimators=1000,
      min_child_weight=300,colsample_bytree=0.8,
      subsample=0.8,eta=0.3,seed=42)
  
  model.fit(X_train,Y_train,eval_metric=&quot;rmse&quot;,eval_set=[(X_train,Y_train)],
           verbose =True,early_stopping_rounds=10)
  </code></pre>
  <p>Where am I getting wrong, if you need anything pls ask
  Thanks for helping !</p>
  <p>EDIT:
  I converted Year type to string and then to int</p>
  <p>BUt the result is like this,</p>
  <pre><code>[461]   validation_0-rmse:8791.25293
  [462]   validation_0-rmse:8791.08789
  </code></pre>