I had spend hours on trying to find the way to sort by frequency with KBinsDiscretizer. My assignment requires to use it. Part 1 was to use equal width buckets, so I used a