Pandas Dataframe row selection combined condition index- and column values : <p>I want to select rows from a dataframe based on values in the index combined with values in a specific column:</p>

<pre><code>df = pd.DataFrame([[0, 2, 3], [0, 4, 1], [0, 20, 30], [40, 20, 30]], 
                  index=[4, 5, 6, 7], columns=['A', 'B', 'C'])


    A   B   C
4   0   2   3
5   0   4   1
6   0  20  30
7  40  20  30
</code></pre>

<p>with</p>

<pre><code>df.loc[df['A'] == 0, 'C'] = 99
</code></pre>

<p>i can select all rows with column A = 0 and replace the value in column C with 99, but how can i select all rows with column A = 0 and the index &lt; 6 (i want to combine selection on the index with selection on the column)?</p>
