title: Pandas indexing by both boolean `loc` and subsequent `iloc`
body: <p>I want to index a Pandas dataframe using a boolean mask, then set a value in a subset of the filtered dataframe based on an integer index, and have this value reflected in the dataframe. That is, I would be happy if this worked on a view of the dataframe.</p>
  
  <p>Example:</p>
  
  <pre><code>In [293]:
  
  df = pd.DataFrame({'a': [0, 1, 2, 3, 4, 5, 6, 7],
                     'b': [5, 5, 2, 2, 5, 5, 2, 2],
                     'c': [0, 0, 0, 0, 0, 0, 0, 0]})
  
  mask = (df['a'] &lt; 7) &amp; (df['b'] == 2)
  df.loc[mask, 'c']
  
  Out[293]:
  2    0
  3    0
  6    0
  Name: c, dtype: int64
  </code></pre>
  
  <p>Now I would like to set the values of the first two elements returned in the filtered dataframe. Chaining an <code>iloc</code> onto the <code>loc</code> call above works to index:</p>
  
  <pre><code>In [294]:
  
  df.loc[mask, 'c'].iloc[0: 2]
  
  Out[294]:
  
  2    0
  3    0
  Name: c, dtype: int64
  </code></pre>
  
  <p>But not to assign:</p>
  
  <pre><code>In [295]:
  
  df.loc[mask, 'c'].iloc[0: 2] = 1
  
  print(df)
  
     a  b  c
  0  0  5  0
  1  1  5  0
  2  2  2  0
  3  3  2  0
  4  4  5  0
  5  5  5  0
  6  6  2  0
  7  7  2  0
  </code></pre>
  
  <p>Making the assign value the same length as the slice (i.e. <code>= [1, 1]</code>) also doesn't work. Is there a way to assign these values?</p>