def isestimable(C, D):
 C = np.asarray(C)
 D = np.asarray(D)
 if (C.ndim == 1):
  C = C[None, :]
 if (C.shape[1] != D.shape[1]):
  raise ValueError(('Contrast should have %d columns' % D.shape[1]))
 new = np.vstack([C, D])
 if (np_matrix_rank(new) != np_matrix_rank(D)):
  return False
 return True

def isestimable ( C , D ) : C = np . asarray ( C ) D = np . asarray ( D ) if ( C . ndim == 1 ) : C = C [ None , : ] if ( C . shape [ 1 ] != D . shape [ 1 ] ) : raise ValueError ( ( 'Contrast should have %d columns' % D . shape [ 1 ] ) ) new = np . vstack ( [ C , D ] ) if ( np_matrix_rank ( new ) != np_matrix_rank ( D ) ) : return False return True
true if contrast c is estimable for design d from an q x p contrast matrix c and an n x p design matrix d .