Fixes the issue of handling NaN/None by using pandas Series in an optimized way.

This fixes an issue I was struggling with: sometimes the pk list is a series of floats (when there are NaN values), and sometimes it's just a series of int.  If it's a series of int, checking whether a pk is NaN raises a TypeError.

After digging, I figured that would be easier to use pandas Series to handle all this.  I made a lot of timeits to find the fastest algorithm I could do without having to use Cython.
It shouldn't be faster however, just as fast as before (when it was buggy).