sklearn.utils.validation.column_or_1d

sklearn.utils.validation.column_or_1d(y, *, warn=False)[source]

Ravel column or 1d numpy array, else raises an error.

Parameters:
yarray-like

Input data.

warnbool, default=False

To control display of warnings.

Returns:
yndarray

Output data.

Raises:
ValueError

If y is not a 1D array or a 2D array with a single row or column.