def _get_bootstrap_sample(x, y, num_reps):
 combined = hstack([x, y])
 total_obs = len(combined)
 num_x = len(x)
 for i in range(num_reps):
  indices = randint(0, total_obs, total_obs)
  sampled = combined.take(indices)
  sampled_x = sampled[:num_x]
  sampled_y = sampled[num_x:]
  (yield (sampled_x, sampled_y))

def _get_bootstrap_sample ( x , y , num_reps ) : combined = hstack ( [ x , y ] ) total_obs = len ( combined ) num_x = len ( x ) for i in range ( num_reps ) : indices = randint ( 0 , total_obs , total_obs ) sampled = combined . take ( indices ) sampled_x = sampled [ : num_x ] sampled_y = sampled [ num_x : ] ( yield ( sampled_x , sampled_y ) )
yields num_reps random samples drawn with replacement from x and y .