title: Why does indexing numpy arrays with brackets and commas differ in behavior?
body: <p>I tend to index numpy arrays (matrices) with brackets, but I've noticed when I want to slice an array (matrix) I must use the comma notation. Why is this? For example,</p>
  
  <pre><code>&gt;&gt;&gt; x = numpy.array([[1, 2], [3, 4], [5, 6]])
  &gt;&gt;&gt; x
  array([[1, 2],
         [3, 4],
         [5, 6]])
  &gt;&gt;&gt; x[1][1]
  4                 # expected behavior
  &gt;&gt;&gt; x[1,1]
  4                 # expected behavior
  &gt;&gt;&gt; x[:][1]
  array([3, 4])     # huh?
  &gt;&gt;&gt; x[:,1]
  array([2, 4, 6])  # expected behavior
  </code></pre>