Question: Using Python 3.Thanks. my_list=[[0 , 1, 4, 17, 67, 76, 51, 28, 3, 1, 0, 0],[0, 1, 8, 28, 69, 129 , 83, 55, 19,
Using Python 3.Thanks.
my_list=[[0 , 1, 4, 17, 67, 76, 51, 28, 3, 1, 0, 0],[0, 1, 8, 28, 69, 129 , 83, 55, 19, 4, 0, 0],[0, 0, 0, 0, 8, 86, 55, 0, 0, 0, 0, 0],[0, 1, 10, 24, 43, 64, 58, 58, 26, 12, 0, 0],[0, 0, 2, 15, 56, 116 , 51, 8, 0, 0, 0, 0]]
the result I want is:
[0, 0.6, 4.8, 16.8, 48.6, 94.2, 59.6, 29.8, 9.6, 3.4, 0, 0]
Notice: It is 0 not 0.0
Here, for example, the third number 4.8 is the mean of each third position in their list.
4.8 =(4+8+0+10+2)/5
You can see the result i want is the mean of each number in their particular position in these lists.
We will define the alert thresholds using the mean and the standard deviation of the case counts for each month. Note you can use the mean() and stdev() function in the statistics library to calculate the mean and standard deviation. >>> import statistics >>> x = [2,3,5,3,4] >>> m statistics.mean(x) >>> sd = statistics.stdev(x) >>print (m) 3.4 >>> print (sd) 1.140175425099138
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
