Answers for "confidence interval using numpy"

1

np confidence interval

import numpy as np
import scipy.stats


def mean_confidence_interval(data, confidence=0.95):
    a = 1.0 * np.array(data)
    n = len(a)
    m, se = np.mean(a), scipy.stats.sem(a)
    h = se * scipy.stats.t.ppf((1 + confidence) / 2., n-1)
    return m, m-h, m+h
Posted by: Guest on March-19-2020

Code answers related to "confidence interval using numpy"

Python Answers by Framework

Browse Popular Code Answers by Language