numpy cast array of ints to floats code example Example: np as type >>> x.astype(int) array([1, 2, 2])