title: How can I simultaneously select all odd rows and all even columns of an array
body: <p>I'm new to programming and I need a program, that can select all odd rows and all even columns of a Numpy array at the same time in one code.
  here is what I tried:</p>
  
  <pre><code>&gt;In [78]: a
  
  &gt;Out[78]:
  &gt;array([[ 1,  2,  3,  4,  5],
  &gt;       [ 6,  7,  8,  9, 10],
  &gt;       [11, 12, 13, 14, 15],
  &gt;       [16, 17, 18, 19, 20]])
  &gt;
  &gt;In [79]: for value in range(a.shape[0]):
  &gt;     if value %2 == 0:
  &gt;        print a[value,:]
  
  &gt;[1 2 3 4 5]
  &gt;[11 12 13 14 15]
  &gt;
  &gt;In [82]: for value in range(a.shape[1]):
  &gt;    if value %2 == 1:
  &gt;        print a[:,value]
  
  &gt;[ 2  7 12 17]
  &gt;[ 4  9 14 19]
  </code></pre>
  
  <p>I've read something with <code>(: even)</code> but don't know in which way I could use it.
  Thanks for your Help.</p>
  
  <p>Han</p>