Question: Problem 1 (15 points) Given a 1D list, calculate its mean using for loops. Mean of a population can be calculated using where vi is

Problem 1 (15 points) Given a 1D list, calculate its mean using for loops. Mean of a population can be calculated using where vi is the ith element and n is the number of elements of list v Constraint: Do not use the built-in mean method or numpy Hint: See Arithmetic mean for the definition In [10]: def mean1dfor(v): Given a 1D list, return its mean nl for i in range(e,n): elem-shape(v) a.append(elem) avg-sum(a) return avg Expected output mean1dfor([1,2,3,4]) -2.5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
