get dataframe slice with list of column names where not all columns are in dataframe
<p>consider <code>df</code></p>

<pre><code>df = pd.DataFrame(np.ones((2, 3)), columns=list('abc'))
df
</code></pre>

<p><a href="https://i.stack.imgur.com/tTb31.png" rel="nofollow"><img src="https://i.stack.imgur.com/tTb31.png" alt="enter image description here"></a></p>

<pre><code>col_list = list('bcd')

df[col_list]
</code></pre>

<p>generates an error</p>

<blockquote>
<pre><code>KeyError: "['d'] not in index"
</code></pre>
</blockquote>

<p>How do I get as many of the columns as I can?</p>

<p><a href="https://i.stack.imgur.com/xzNqZ.png" rel="nofollow"><img src="https://i.stack.imgur.com/xzNqZ.png" alt="enter image description here"></a></p>