title: Filtering a dataframe using a list of strings
body: <p>I have the following dataframe, called pop_df:</p>
  <pre><code>pop_df
  Out[33]: 
              2014       2015       2016       2017       2018       2019
  Geo                                                                    
  AL     2892394.0  2885796.0  2875592.0  2876591.0  2870324.0  2862427.0
  AL0    2892394.0  2885796.0  2875592.0  2876591.0  2870324.0  2862427.0
  AL01    844921.0   836448.0   830981.0   826904.0   819793.0   813758.0
  AL011   134332.0   131054.0   129056.0   125579.0   120978.0   118948.0
  AL012   276058.0   277989.0   280205.0   284823.0   289626.0   290126.0
           ...        ...        ...        ...        ...        ...
  UKN12   142028.0   142756.0   143363.0   143746.0   144105.0   144367.0
  UKN13   139774.0   140222.0   140752.0   141368.0   141994.0   142565.0
  UKN14   137722.0   139426.0   140691.0   141917.0   143286.0   144771.0
  UKN15   136332.0   136904.0   137492.0   138000.0   138441.0   138948.0
  UKN16   114696.0   115171.0   115581.0   116057.0   116612.0   117051.0
  
  [2034 rows x 6 columns]
  </code></pre>
  <p>I also have a list of EU country codes:</p>
  <pre><code>EuropeanUnion=[&quot;BE&quot;,&quot;BG&quot;,&quot;CZ&quot;,&quot;DK&quot;,&quot;DE&quot;,&quot;EE&quot;,&quot;IE&quot;,&quot;EL&quot;,&quot;ES&quot;,&quot;FR&quot;,&quot;HR&quot;,&quot;IT&quot;,&quot;CY&quot;,&quot;LV&quot;,&quot;LT&quot;,&quot;LU&quot;,&quot;HU&quot;,&quot;MT&quot;,&quot;NL&quot;,&quot;AT&quot;,&quot;PL&quot;,&quot;PT&quot;,&quot;RO&quot;,&quot;SI&quot;,&quot;SK&quot;,&quot;FI&quot;,&quot;SE&quot;]
  </code></pre>
  <p>I would like to filter the dataframe to keep only the rows <strong>starting</strong> by the country codes that are in the list. I tried with <code>pop_df.index.str.startswith</code> but I couldn't make it work. I'd appreciate any help you can provide. Thanks in advance!</p>