title: Dropping multiple Pandas columns by Index
body: <p>I have a large pandas dataframe (>100 columns). I need to drop various sets of columns and i'm hoping there is a way of using the old</p>
  
  <pre><code>df.drop(df.columns['slices'],axis=1)
  </code></pre>
  
  <p>I've built selections such as:</p>
  
  <pre><code>a = df.columns[3:23]
  b = df.colums[-6:]
  </code></pre>
  
  <p>as <code>a</code> and <code>b</code> represent column sets I want to drop.</p>
  
  <p>The following</p>
  
  <pre><code>list(df)[3:23]+list(df)[-6:]
  </code></pre>
  
  <p>yields the correct selection, but i can't implement it with a <code>drop</code>:</p>
  
  <pre><code>df.drop(df.columns[list(df)[3:23]+list(df)[-6:]],axis=1)
  </code></pre>
  
  <blockquote>
    <p>ValueError: operands could not be broadcast together with shapes (20,)
    (6,)</p>
  </blockquote>
  
  <p>I looked around but can't get my answer.</p>
  
  <p><a href="https://stackoverflow.com/questions/33042633/selecting-last-n-columns-and-excluding-last-n-columns-in-dataframe">Selecting last n columns and excluding last n columns in dataframe</a> </p>
  
  <p>(Below pertains to the error I receive):</p>
  
  <p><a href="https://stackoverflow.com/questions/24560298/python-numpy-valueerror-operands-could-not-be-broadcast-together-with-shapes">python numpy ValueError: operands could not be broadcast together with shapes</a></p>
  
  <p>This one feels like they're having a similar issue, but the 'slices' aren't separate:
  <a href="https://stackoverflow.com/questions/28538536/deleting-multiple-columns-based-on-column-names-in-pandas">Deleting multiple columns based on column names in Pandas</a></p>
  
  <p>Cheers</p>