What's wrong? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What's wrong?

Вам дан массив, который отражает цены на дома. Рассчитайте и выведите процент домов, которые находятся в пределах одного среднеквадратического отклонения от среднего. import numpy as np data = np.array([150000, 125000, 320000, 540000, 200000, 120000, 160000, 230000, 280000, 290000, 300000, 500000, 420000, 100000, 150000, 280000]) count=0 for i in data: if i>np.std(data): count+=1 result=count/len(data)*100 print(result,"%")

6th Jun 2022, 4:08 AM
Кирилл Степанченко
1 Answer
0
You didn't calculate the mean. This code is finding the percentage of houses whose price is greater than one standard deviation, which should be all of them. Also, "within one standard deviation of the mean" means houses in the range mean-std to mean+std
10th Jul 2022, 7:21 PM
Steve
Steve - avatar