if isinstance(y, list):
y_ary = np.array(y)
else:
y_ary = y
for a in (X, y_ary):
if not isinstance(a, np.ndarray):
After Change
if not isinstance(X, np.ndarray):
raise ValueError("X must be a 2D NumPy array")
if not isinstance(y, np.ndarray):
raise ValueError("y must be a 1D NumPy array")
if not np.issubdtype(y.dtype, np.integer):
raise ValueError("y must have be an integer array. "
"Try passing the array as y.astype(np.integer)")