def inconsistent(Z, d=2):
 Z = np.asarray(Z, order='c')
 Zs = Z.shape
 is_valid_linkage(Z, throw=True, name='Z')
 if ((not (d == np.floor(d))) or (d < 0)):
  raise ValueError('The second argument d must be a nonnegative integer value.')
 [Z] = _copy_arrays_if_base_present([Z])
 n = (Zs[0] + 1)
 R = np.zeros(((n - 1), 4), dtype=np.double)
 _hierarchy.inconsistent(Z, R, int(n), int(d))
 return R

def inconsistent ( Z , d = 2 ) : Z = np . asarray ( Z , order = 'c' ) Zs = Z . shape is_valid_linkage ( Z , throw = True , name = 'Z' ) if ( ( not ( d == np . floor ( d ) ) ) or ( d < 0 ) ) : raise ValueError ( 'The second argument d must be a nonnegative integer value.' ) [ Z ] = _copy_arrays_if_base_present ( [ Z ] ) n = ( Zs [ 0 ] + 1 ) R = np . zeros ( ( ( n - 1 ) , 4 ) , dtype = np . double ) _hierarchy . inconsistent ( Z , R , int ( n ) , int ( d ) ) return R
calculates inconsistency statistics on a linkage matrix .