def maxRstat(Z, R, i):
 Z = np.asarray(Z, order='c')
 R = np.asarray(R, order='c')
 is_valid_linkage(Z, throw=True, name='Z')
 is_valid_im(R, throw=True, name='R')
 if (type(i) is not int):
  raise TypeError('The third argument must be an integer.')
 if ((i < 0) or (i > 3)):
  raise ValueError('i must be an integer between 0 and 3 inclusive.')
 if (Z.shape[0] != R.shape[0]):
  raise ValueError('The inconsistency matrix and linkage matrix each have a different number of rows.')
 n = (Z.shape[0] + 1)
 MR = np.zeros(((n - 1),))
 [Z, R] = _copy_arrays_if_base_present([Z, R])
 _hierarchy.get_max_Rfield_for_each_cluster(Z, R, MR, int(n), i)
 return MR

def maxRstat ( Z , R , i ) : Z = np . asarray ( Z , order = 'c' ) R = np . asarray ( R , order = 'c' ) is_valid_linkage ( Z , throw = True , name = 'Z' ) is_valid_im ( R , throw = True , name = 'R' ) if ( type ( i ) is not int ) : raise TypeError ( 'The third argument must be an integer.' ) if ( ( i < 0 ) or ( i > 3 ) ) : raise ValueError ( 'i must be an integer between 0 and 3 inclusive.' ) if ( Z . shape [ 0 ] != R . shape [ 0 ] ) : raise ValueError ( 'The inconsistency matrix and linkage matrix each have a different number of rows.' ) n = ( Z . shape [ 0 ] + 1 ) MR = np . zeros ( ( ( n - 1 ) , ) ) [ Z , R ] = _copy_arrays_if_base_present ( [ Z , R ] ) _hierarchy . get_max_Rfield_for_each_cluster ( Z , R , MR , int ( n ) , i ) return MR
returns the maximum statistic for each non-singleton cluster and its descendents .