Note that `np.float32` values are not instances of `float`. It's easier to check for an `int` explicitly with `isinstance(x, numbers.Integral)`, that catches most of the NumPy integer types as well.