title: how to use python to select first X columns and last Y columns
body: <p>I am trying to select column 1 to 8 and the last column from a data frame. I have some dumb way to do that</p>
  
  <p>step 1: select first 8 column</p>
  
  <pre><code>df1 = df[df.columns[range(9)]]
  </code></pre>
  
  <p>step 2: select last column</p>
  
  <pre><code>df2 = df[df.columns[-1]]
  </code></pre>
  
  <p>step 3: combine step1 and step2</p>
  
  <pre><code>df1.join(df2)
  </code></pre>
  
  <p>is there a better way to do that in one step instead of 3 steps?</p>