from sklearn import tree Y = data['Class'] X = data.drop(['Name','Class'],axis=1) clf = tree.DecisionTreeClassifier(criterion='entropy',max_depth=3) clf = clf.fit(X, Y)