how to calculate mean in python
import statistics
a = [1,2,3,4,5]
mean = statistics.mean(a) 
#Similar for other values such as variance, standard deviationhow to calculate mean in python
import statistics
a = [1,2,3,4,5]
mean = statistics.mean(a) 
#Similar for other values such as variance, standard deviationcalculate mean on python
def calculate_mean(n):
    s = sum(n)
    N = len(n)
    
    mean = s / N
    
    return meanget mean using python
# --------------------- MEAN ---------------------
# Dataset for questions -
dataset = [2, 1, 1, 4, 5, 8, 12, 4, 3, 8, 21, 1, 18, 5]
# Finding sum of dataset
sumOfDataset = sum(dataset)
# Finding length of dataset
lenOfDataset = len(dataset)
# Calculating the mean by dividing the sum of dataset with the length of dataset
mean = sumOfDataset / lenOfDataset
# Printing the mean of dataset
print(mean)Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us
