Python Supervised Binning Algorithmic Problem