Pandas Dataframe to DMatrix I am trying to run xgboost in scikit learn.  And I am only using Pandas to load the data into a dataframe. How am I supposed to use pandas df with xgboost?  I am confused by the DMatrix routine required to run the xgboost algorithm.
You can use the dataframe's .values method to access raw data once you have manipulated the columns as you need them.

E.g.

train = pd.read_csv("train.csv")
target = train['target']
train = train.drop(['ID','target'],axis=1)
test = pd.read_csv("test.csv")
test = test.drop(['ID'],axis=1)

xgtrain = xgb.DMatrix(train.values, target.values)
xgtest = xgb.DMatrix(test.values)


Obviously you may need to change which columns you drop or use as the training target. The above was for a Kaggle competition, so there was no target data for xgtest (it is held back by the organisers).