I don't think that works. You get the unique classes but then what? All that helps you with is knowing the classes ahead of time, you still have to hash each element to increment it in the dict.

Maybe I'm being dense, just write the one or two lines of code that could replace ``_histogram`` with unique and bincount?