title: what does numpy.apply_along_axis perform exactly?
body: <p>I have come across the <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.apply_along_axis.html" rel="noreferrer">numpy.apply_along_axis</a> function in some code. And I don't understand the documentation about it.</p>
  <p>This is an example of the documentation:</p>
  <pre><code>&gt;&gt;&gt; def new_func(a):
  ...     &quot;&quot;&quot;Divide elements of a by 2.&quot;&quot;&quot;
  ...     return a * 0.5
  &gt;&gt;&gt; b = np.array([[1,2,3], [4,5,6], [7,8,9]])
  &gt;&gt;&gt; np.apply_along_axis(new_func, 0, b)
  array([[ 0.5,  1. ,  1.5],
         [ 2. ,  2.5,  3. ],
         [ 3.5,  4. ,  4.5]])
  </code></pre>
  <p>As far I as thought I understood the documentation, I would have expected:</p>
  <pre><code>array([[ 0.5,  1. ,  1.5],
         [ 4  ,  5  ,  6  ],
         [ 7  ,  8  ,  9  ]])
  </code></pre>
  <p>i.e.  having applied the function along the axis <strong>[1,2,3]</strong> which is axis <strong>0</strong> in [[1,2,3], [4,5,6], [7,8,9]]</p>
  <p>Obviously I am wrong. Could you correct me ?</p>