adding nan/inf check using numpy so we can be fast when we can

we can probably do the "NaN", "Infinity", "-Infinity" conversion with numpy as well, but we would need to do some dtype conversions first