title: How to get every nth column in pandas?
body: <p>I have a dataframe which looks like this:</p>
  
  <pre><code>    a1    b1    c1    a2    b2    c2    a3    ...
  x   1.2   1.3   1.2   ...   ...   ...   ...
  y   1.4   1.2   ...   ...   ...   ...   ...
  z   ...
  </code></pre>
  
  <p>What I want is grouping by every nth column. In other words, I want a dataframe with all the as, one with bs and one with cs</p>
  
  <pre><code>    a1     a2     a4
  x   1.2    ...    ...
  y
  z
  </code></pre>
  
  <p>In another SO question I saw that is possibile to do <code>df.iloc[::5,:]</code>, for example, to get every 5th raw. I could do of course <code>df.iloc[:,::3]</code> to get the c cols but it doesn't work for getting a and b.</p>
  
  <p>Any ideas?</p>