title: Weighted mean in numpy/python
body: <p>I have a big continuous array of values that ranges from (-100, 100) </p>
  
  <p>Now for this array I want to calculate the weighted average <a href="http://www.mathsisfun.com/data/weighted-mean.html" rel="nofollow">described here</a></p>
  
  <p>since it's continuous I want also to set breaks for the values every 20 
  i.e the values should be discrete as 
  -100
  -80
  -60
  ....
  60
  80
  100</p>
  
  <p>How can I do this in NumPy or python in general?</p>
  
  <p>EDIT: the difference here from the normal mean, that the mean is calculated according to the frequency of values</p>