Computes the central credible interval.

        If percentage=90, computes the 90% CI.

        Args:
            percentage: float between 0 and 100

        Returns:
            sequence of two floats, low and high
541898
def CredibleInterval(self, percentage=90):
        
        prob = (1 - percentage / 100.0) / 2
        interval = self.Value(prob), self.Value(1 - prob)
        return interval
234160
def midpoint(self) -> float:
        
        return (self.bid + self.ask) / 2 if self.hasBidAsk() else nan
506907
def percentage_distance(cls, highmark, current):
        """"""
        highmark = int(highmark)
        current = int(current)
        if highmark > 0:
            return round(
                (highmark - current) * 100.0 / highmark,
                2,
            )
        else:
            return 0.0
1220756
def two_point_field_goal_percentage(self):
        
        try:
            result = float(self.two_point_field_goals) / \
                float(self.two_point_field_goal_attempts)
            return round(result, 3)
        except ZeroDivisionError:
            return 0.0
1146238
def cloud_percent(self):
        """"""
        image_content_qi = self._metadata.findtext(
            (
                """n1:Quality_Indicators_Info/Image_Content_QI/CLOUDY_PIXEL_PERCENTAGE"""
            ),
            namespaces=self._nsmap)
        return float(image_content_qi)
218621
def median_hilow(series, confidence_interval=0.95):
    
    tail = (1 - confidence_interval) / 2
    return pd.DataFrame({'y': [np.median(series)],
                         'ymin': np.percentile(series, 100 * tail),
                         'ymax': np.percentile(series, 100 * (1 - tail))})
699123
def confidence_interval_cumulative_density_(self):
        
        return self._compute_confidence_bounds_of_transform(self._cumulative_density, self.alpha, self._ci_labels)
104237
def true_neg_rate(self):
        
        false_pos = self.matrix[1][0]
        true_neg = self.matrix[1][1]
        return divide(1.0 * true_neg, true_neg + false_pos)
506711
def Percentile(pmf, percentage):
    
    p = percentage / 100.0
    total = 0
    for val, prob in pmf.Items():
        total += prob
        if total >= p:
            return val
210471
def nPercentile(requestContext, seriesList, n):
    """"""
    assert n, 'The requested percent is required to be greater than 0'

    results = []
    for s in seriesList:
        # Create a sorted copy of the TimeSeries excluding None values in the
        # values list.
        s_copy = TimeSeries(s.name, s.start, s.end, s.step,
                            sorted(not_none(s)))
        if not s_copy:
            continue    # Skip this series because it is empty.

        perc_val = _getPercentile(s_copy, n)
        if perc_val is not None:
            name = 'nPercentile(%s, %g)' % (s_copy.name, n)
            point_count = int((s.end - s.start)/s.step)
            perc_series = TimeSeries(name, s_copy.start, s_copy.end,
                                     s_copy.step, [perc_val] * point_count)
            perc_series.pathExpression = name
            results.append(perc_series)
    return results
254831
def as_percent(precision=2, **kwargs):
    
    if not isinstance(precision, Integral):
        raise TypeError("Precision must be an integer.")

    return _surpress_formatting_errors(
        _format_numer(".{}%".format(precision))
    )
877261
def percent_point(self, U):
        
        self.check_fit()
        return norm.ppf(U, loc=self.mean, scale=self.std)
694151
def average_true_range_percent(close_data, period):
    
    catch_errors.check_for_period_error(close_data, period)
    atrp = (atr(close_data, period) / np.array(close_data)) * 100
    return atrp
109653
def as_percent(self, percent):
        
        if not self:
            return self.wrap_str()

        length = len(self)
        # Using mod 100, to provide some kind of "auto reset". 0 is 0 though.
        percentmod = (int(percent) % 100) or min(percent, 100)
        index = int((length / 100) * percentmod)
        try:
            barstr = str(self[index])
        except IndexError:
            barstr = self[-1]

        return self.wrap_str(barstr)
608276
def MaxLikeInterval(self, percentage=90):
        
        interval = []
        total = 0

        t = [(prob, val) for val, prob in self.Items()]
        t.sort(reverse=True)

        for prob, val in t:
            interval.append(val)
            total += prob
            if total >= percentage / 100.0:
                break

        return interval
129523
def percent_of_the_time(p):
    
    def decorator(fn):

        def wrapped(*args, **kwargs):
            if in_percentage(p):
                fn(*args, **kwargs)

        return wrapped

    return decorator
684810
def cum_percentile(series,q):
    
    total = series.sum()
    cum_sum = series.cumsum()
    return sum(cum_sum < total*q)