示例#1
0
def fences(filepath):
    data = load_data(filepath)
    lower = np.percentile(data, 25)
    upper = np.percentile(data, 75)
    interquartile_range = upper - lower
    lower_fence = lower - 1.5 * interquartile_range
    upper_fence = upper + 1.5 * interquartile_range
    return lower_fence, upper_fence
def compute_cutoff(filepath):
    data = load_data(filepath)
    """mu = np.average(data)
    sigma = np.std(data)
    #cutoff = mu + 1 * sigma
    #return round(cutoff)"""
    upper = np.percentile(data, 75)
    return upper
def compute_mu_sd(filepath):
    data = load_data(filepath)
    mu = np.average(data)
    sigma = np.std(data)
    return mu, sigma