address all the comments:

1. implement lookup(), similar to that in Scala
2. handle None, nan, inf in histogram, add many tests
3. remove collectPartitions()
4. improve docs