A tree's first question is the single split that separates the classes most cleanly. You want to know which column it asks about.
Write first_question(rows, labels, names).
names holds the column names, in the same order as each row.DecisionTreeClassifier(max_depth=1, random_state=0).export_text(model, feature_names=names) to get the tree as text. Its first line has the form |--- <column name> <= <threshold>.Return a dict:
"column": the name of the column the first question uses, as a string."threshold": the number in that question, as a float, exactly as export_text shows it.