I think you can just coerce to float (if it fails that your fallback is fine, though that itself takes some time, might be better just to check the index type first) you don't need the isnull/isnan checking at all, just do ``(left != left) & (right != right)``