(latitudes)
return lower_bound, upper_bound
Estimate latitude bound with 2*sample standard deviation
Estimate latitude bound with 2*sample standard deviation
Estimate latitude bound with 2 * sample standard deviation
def latitude_bounds(latitudes):
    """
    Estimate latitude bound with 2*sample standard deviation
    """
    if max(latitudes) - min(latitudes) < 2.0*EPSILON:
        lower_bound = latitudes[0] - EPSILON
        upper_bound = latitudes[0] + EPSILON
    else:
        N = float(len(latitudes))
        mean = sum(latitudes) / N
        sum_squares = sum(
            (latitude-mean)**2 for latitude in latitudes
        )
        standard_deviation = math.sqrt(sum_squares/float(N))
        lower_bound = max(mean - 2.0*standard_deviation, -(90.0 - EPSILON))
        upper_bound = min(mean + 2.0*standard_deviation, (90.0 - EPSILON))
    lower_bound, upper_bound = _constrain_latitude_bounds(
        lower_bound, upper_bound)
    return lower_bound, upper_bound
def latitude_bounds ( latitudes ) : if max ( latitudes ) - min ( latitudes ) < 2.0 * EPSILON : lower_bound = latitudes [ 0 ] - EPSILON upper_bound = latitudes [ 0 ] + EPSILON else : N = float ( len ( latitudes ) ) mean = sum ( latitudes ) / N sum_squares = sum ( ( latitude - mean ) ** 2 for latitude in latitudes ) standard_deviation = math . sqrt ( sum_squares / float ( N ) ) lower_bound = max ( mean - 2.0 * standard_deviation , - ( 90.0 - EPSILON ) ) upper_bound = min ( mean + 2.0 * standard_deviation , ( 90.0 - EPSILON ) ) lower_bound , upper_bound = _constrain_latitude_bounds ( lower_bound , upper_bound ) return lower_bound , upper_bound