def mw_boot(x, y, num_reps=999):
 tol = (MACHEP * 100)
 (observed_stat, obs_p) = mw_t(x, y)
 u_stats_as_or_more_extreme = 0
 for (sampled_x, sampled_y) in _get_bootstrap_sample(x, y, num_reps):
  try:
   (sample_stat, sample_p) = mw_t(sampled_x, sampled_y)
   if (sample_stat <= (observed_stat - tol)):
    u_stats_as_or_more_extreme += 1
  except ValueError:
   pass
 return (observed_stat, ((u_stats_as_or_more_extreme + 1) / (num_reps + 1)))

def mw_boot ( x , y , num_reps = 999 ) : tol = ( MACHEP * 100 ) ( observed_stat , obs_p ) = mw_t ( x , y ) u_stats_as_or_more_extreme = 0 for ( sampled_x , sampled_y ) in _get_bootstrap_sample ( x , y , num_reps ) : try : ( sample_stat , sample_p ) = mw_t ( sampled_x , sampled_y ) if ( sample_stat <= ( observed_stat - tol ) ) : u_stats_as_or_more_extreme += 1 except ValueError : pass return ( observed_stat , ( ( u_stats_as_or_more_extreme + 1 ) / ( num_reps + 1 ) ) )
bootstrapped version of mann-whitney-u test parameters x : array-like list or array of numeric values to be tested .