Update common.py

Force violate array to be of type int. When no nan values are found, the array defaults to an empty array of type float, so you get an error: *** IndexError: arrays used as indices must be of integer (or boolean) type
You cannot use `int` here. Let's say you have an array `x = array([1, 2, 3])`. When you slice it with `idx  = np.array([True, False, True])`, i.e., `y = x[idx]` then `y == np.array([1, 3])`, whereas if you slice it with `idx = np.array([1, 0, 1])`, then `y == np.array([2, 1, 2])`.