slicing pandas dataframe with an array of indices
<p>I have a pandas dataframe like this..</p>

<pre><code>df = pd.DataFrame({'A' : [5,6,3,4,4,5,6,7,12,13], 'B' : 
     [1,2,3,5,5,6,7,8,9,10,]})

df

    A   B
0   5   1
1   6   2
2   3   3
3   4   5
4   4   5
5   5   6
6   6   7  
7   7   8
8  12   9
9  13  10
</code></pre>

<p>and I have an array of indices</p>

<pre><code>array = np.array([0,1,2,4,7,8])
</code></pre>

<p>Now I can subset the dataframe with the array indices like this</p>

<pre><code>df.iloc[array]
</code></pre>

<p>Which gives me a dataframe with indices present in the array. </p>

<pre><code>    A  B
0   5  1
1   6  2
2   3  3
4   4  5
7   7  8
8  12  9
</code></pre>

<p>Now I want all the rows which are not present in the array index, row index which i want is <code>[3,5,6,9]</code> 
I am trying to do something like this but it gives me an error.</p>

<p><code>df.iloc[~loc]</code></p>