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,"%")
1 ответ
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