How to delete all columns in DataFrame except certain ones? : <p>Let's say I have a DataFrame that looks like this:</p>

<pre><code>a  b  c  d  e  f  g  
1  2  3  4  5  6  7
4  3  7  1  6  9  4
8  9  0  2  4  2  1
</code></pre>

<p>How would I go about deleting every column besides <code>a</code> and <code>b</code>?</p>

<p>This would result in:</p>

<pre><code>a  b
1  2
4  3
8  9
</code></pre>

<p>I would like a way to delete these using a simple line of code that says, delete all columns besides <code>a</code> and <code>b</code>, because let's say hypothetically I have 1000 columns of data.</p>

<p>Thank you.</p>
