title: Why does numpy.histogram (Python) leave off one element as compared to hist in Matlab?
body: <p>I am trying to convert some Matlab code to Python, and the Matlab code looks like:</p>
  
  <pre><code>[N,X] = hist(Isb*1e6, -3:0.01:0)
  </code></pre>
  
  <p>where Isb is a 2048000 element 1D array. N is output as a 301 element 1D array.</p>
  
  <p>My Python code looks like:</p>
  
  <pre><code>import numpy as np
  N,X = np.histogram(Isb*1e6,np.array(-3,0.01,0.01))
  </code></pre>
  
  <p>but the N Python outputs is a 300 element 1D array where the last element from the Matlab N is left off.</p>
  
  <p>Is there a way to replicate what Matlab does more accurately?</p>
  
  <p>I need N and X to be the same size so that I can do this:</p>
  
  <pre><code>loc = X &lt; -0.75
  I   = N[loc].argmax()
  </code></pre>