numpy check vector code example Example: numpy check vector if weight.ndim != 1: raise ValueError("The is not a row vector.")