train = pd.DataFrame({'a': ['a', 'b', 'a'], 'd': ['e', 'e', 'f'], 'b': [0, 
    1, 1], 'c': ['b', 'c', 'b']})
samples = [dict(enumerate(sample)) for sample in train]
Использование DictVectorizer с sklearn DecisionTreeClassifier