def num_obs_y(Y):
 Y = np.asarray(Y, order='c')
 is_valid_y(Y, throw=True, name='Y')
 k = Y.shape[0]
 if (k == 0):
  raise ValueError('The number of observations cannot be determined on an empty distance matrix.')
 d = int(np.ceil(np.sqrt((k * 2))))
 if (((d * (d - 1)) / 2) != k):
  raise ValueError('Invalid condensed distance matrix passed. Must be some k where k=(n choose 2) for some n >= 2.')
 return d

def num_obs_y ( Y ) : Y = np . asarray ( Y , order = 'c' ) is_valid_y ( Y , throw = True , name = 'Y' ) k = Y . shape [ 0 ] if ( k == 0 ) : raise ValueError ( 'The number of observations cannot be determined on an empty distance matrix.' ) d = int ( np . ceil ( np . sqrt ( ( k * 2 ) ) ) ) if ( ( ( d * ( d - 1 ) ) / 2 ) != k ) : raise ValueError ( 'Invalid condensed distance matrix passed. Must be some k where k=(n choose 2) for some n >= 2.' ) return d
returns the number of original observations that correspond to a condensed distance matrix .