Use pandas to deal with categorical lookups on mixed-type arrays

This should handle problems associated with using np.searchsorted and np.unique on mixed-type arrays in python3.