def whiten_individuals_loop(x, transform, group_iter):
 x_new = []
 for g in group_iter():
  x_g = x[g]
  x_new.append(np.dot(transform, x_g))
 return np.concatenate(x_new)

def whiten_individuals_loop ( x , transform , group_iter ) : x_new = [ ] for g in group_iter ( ) : x_g = x [ g ] x_new . append ( np . dot ( transform , x_g ) ) return np . concatenate ( x_new )
apply linear transform for each individual loop version .