title: What does axis = 0 do in Numpy's sum function?
body: <p>I am learning Python, and have encountered <code>numpy.sum</code>. It has an optional parameter <code>axis</code>. This parameter is used to get either column-wise summation or row-wise summation. When <code>axis = 0</code> we imply to sum it over columns only. For example,</p>
  
  <pre><code>a = np.array([[1, 2, 3], [4, 5, 6]])
  np.sum(a, axis = 0)
  </code></pre>
  
  <p>This snippet of code produces output: <code>array([5, 7, 9])</code>, fine. But if I do:</p>
  
  <pre><code>a = np.array([1, 2, 3])
  np.sum(a, axis = 0)
  </code></pre>
  
  <p>I get result: <code>6</code>, why is that? Shouldn't I get <code>array([1, 2, 3])</code>?</p>