title: How does numpy.histogram works with the normal=True option
body: <p>I got one question about the numpy.histogram option <strong>normed</strong>, the function is:</p>
  
  <p>numpy.histogram(a, bins=10, range=None, <strong>normed</strong>=False, weights=None, density=None)</p>
  
  <p>By the definition: <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html" rel="nofollow noreferrer">numpy.histogram</a></p>
  
  <p><strong>normed</strong> : bool, optional</p>
  
  <p>This keyword is deprecated in Numpy 1.6 due to confusing/buggy behavior. It will be removed in Numpy 2.0. Use the density keyword instead. If False, the result will contain the number of samples in each bin. If True, the result is the value of the probability density function at the bin, normalized such that the integral over the range is 1. Note that this latter behavior is known to be buggy with unequal bin widths; use density instead.
  weights : array_like, optional</p>
  
  <p>I try it with this code:</p>
  
  <pre><code>   imhist, bins = histogram([0,1,2,3], bins=4, normed=True)
     print "normed=True:", imhist
     print "bins:", bins
     Output:
     normal=True: [ 0.33333333  0.33333333  0.33333333  0.33333333]
     bins: [ 0.    0.75  1.5   2.25  3.  ]
  
     imhist, bins = histogram([0,1,2,3], bins=4)
     print "normed=None:", imhist
     print "bins:", bins
     Output:
     normal=None: [1 1 1 1]
     bins: [ 0.    0.75  1.5   2.25  3.  ]
  </code></pre>
  
  <p>What I am feel confused is about the when normed=True, "the result is the value of the probability density function at the bin, normalized such that the integral over the range is 1." Because I thought the imhist should be this:</p>
  
  <pre><code>   normal=True: [0.25  0.25  0.25  0.25]
  </code></pre>
  
  <p>The 4 values equally drop in 4 bins, and that is why "normal=None: [1 1 1 1]"</p>
  
  <pre><code>   Value:[ 0         1      2      3   ]
     bins: [ 0.    0.75  1.5   2.25  3.  ]
  </code></pre>
  
  <p>I have refer to this <a href="https://stackoverflow.com/questions/9141732/how-does-numpy-histogram-work">How does numpy.histogram() work?</a> post, but it does use the normed=True option.</p>