The output differs from bottleneck, which also gives nans, but fewer. The Factor version never outputs nans and otherwise matches the pandas version. https://gist.github.com/3624548