How to select rows in pandas based on list of values
<p>I'm trying to find out a way how I can select rows in pandas dataframe based that some values will be in my list. For example</p>

<pre><code>df = pd.DataFrame(np.arange(6).reshape(3,2), columns=['A','B'])
   A  B
0  0  1
1  2  3
2  4  5
</code></pre>

<p>I know that I can select certain row, e.g.</p>

<pre><code>df[df.A==0]
</code></pre>

<p>will select me row with A=0. What I want is to select multiple rows whose values will be in my list, e.g. A in [0,2]. I tried</p>

<pre><code>df[df.A in [0,2]]
df[list(df.A)==[0,2]]
</code></pre>

<p>but nothing works. In R language I can provide %in% operator. In python syntax we can use A in [0,2], etc. How I can select subset of rows in pandas in this case?
Thanks,
Valentin.</p>