Since version 0.19 (which is a pretty old one..) , the min_impurity_decrease defaults to 0.0, which means that we can have split nodes (pure nodes) with samples belonging to only one class.
Ex.
In this scenario, the actual code will fails for hist, bins, barcontainers = ax.hist(X_hist,.... because for a node with samples from only one class will return a Rectangle instead of a list of BarContainer.
Since version 0.19 (which is a pretty old one..) , the min_impurity_decrease defaults to 0.0, which means that we can have split nodes (pure nodes) with samples belonging to only one class. Ex.
In this scenario, the actual code will fails for
hist, bins, barcontainers = ax.hist(X_hist,....
because for a node with samples from only one class will return a Rectangle instead of a list of BarContainer.