I am new to python coding and I am trying to make my own functions such as mean and standard deviation on my own as practice. However, I am having trouble making a function for finding variance. the formula being
1 / (N - 1)
times
N Sigma i=1 f(x)
where
f(x) = (x - µ) ** 2 for each x[i]
?
As I understand from math studies some decades ago, N - 1 is for a sample as opposed to a population? Just so your intentions are clear.
This question deals only with dissemination of your formula.
Now if this is correctly disseminated then it means there is a problem with the formula presented in the OP; to wit:
I don’t know NumPy, but if that is the exponent operator, then it doesn’t belong between parameters. Mind, if there is some definition I am unaware of, you will forgive me.