Answers for "mean sigma and confidence interval is given how to achive the answer in python for normal distribution"

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 "mean sigma and confidence interval is given how to achive the answer in python for normal distribution"

Python Answers by Framework

Browse Popular Code Answers by Language