Medium Decision Tree Python