title: Are numpy-matrix-functions buffered?
body: <p>Are numpy matrix specific functions, such as <code>x.max()</code> buffered when applied several times?</p>
  
  <p>So should one write:</p>
  
  <pre><code>bincount=np.apply_along_axis(lambda x: np.bincount(x, minlength=data.max()+1), axis=0, arr=data)
  </code></pre>
  
  <p>or better</p>
  
  <pre><code>data_max=data.max()+1
  bincount=np.apply_along_axis(lambda x: np.bincount(x, minlength=data_max), axis=0, arr=data)
  </code></pre>
  
  <p>where data is e.g.</p>
  
  <pre><code>data=np.array([[1,2,5,4,8,7,8,9,14,8,14,5,2,1],
                 [5,8,7,13,7,8,9,21,5,7,9,24,3,2]])
  </code></pre>
  
  <p>or of course even much larger</p>