+ 2
House prices project python
I’m confused what I did wrong? This is my code import numpy as np data = np.array([150000, 125000, 320000, 540000, 200000, 120000, 160000, 230000, 280000, 290000, 300000, 500000, 420000, 100000, 150000, 280000]) mean=sum(data)/len(data) stdvar=(sum((v-mean)**2 for v in data)/len(data))**0.5 total=sum(data) low, high=mean-stdvar, mean+stdvar p=(len([v for v in data if low<v<high])/total)**100 print(p) But doesn’t pass, can someone help me please?
1 Réponse
+ 2
I am not sure what the goal is. But I have some comments.
1. You are creating a numpy array but not using any numpy functions. You could just use a regular python list.
2. Why do you do "power to 100" (**100) for p?