title: ignore KeyError while subsetting pandas dataframe
body: <p>I have a pandas dataframe df with columns <code>city1</code>, <code>city2</code>, <code>city3</code>, <code>city4</code>, <code>city5</code>. I have a list <code>my_cities = [&quot;city1&quot;,&quot;city3&quot;,&quot;city10&quot;]</code>. I want to subset df according to the columns in <code>my_cities</code>. When I do,</p>
  <pre><code>my_cities = [&quot;city1&quot;,&quot;city3&quot;,&quot;city10&quot;]
  
  df_my_cities = df[my_cities]
  </code></pre>
  <p>I get the error <code>KeyError: &quot;['city10'] not in index&quot;</code></p>
  <p>How can I tell the code to keep proceeding if an element from <code>my_cities</code> in not in <code>df</code>?</p>