title: Selecting rows based on a column value
body: <p>I have a data frame something like this </p>
  
  <pre><code>data = {'ID': [1,2,3,4,5,6,7,8,9],
         'Doc':['Order','Order','Inv','Order','Order','Shp','Order', 'Order','Inv'],
         'Rep':[101,101,101,102,102,102,103,103,103]}
  frame = pd.DataFrame(data)
  
  
      Doc     ID  Rep
  0   Order   1   101
  1   Order   2   101
  2   Inv     3   101
  3   Order   4   102
  4   Order   5   102
  5   Shp     6   102
  6   Order   7   103
  7   Order   8   103
  8   Inv     9   103
  </code></pre>
  
  <p>Now I want to select rows for Rep that have Doc type as Inv only. </p>
  
  <p>I want a dataframe as </p>
  
  <pre><code>    Doc     ID  Rep
  0   Order   1   101
  1   Order   2   101
  2   Inv     3   101
  6   Order   7   103
  7   Order   8   103
  8   Inv     9   103
  </code></pre>
  
  <p>All reps will have Doc type Orders so I was trying to do something like this </p>
  
  <pre><code>frame[frame.Rep == frame.Rep[frame.Doc == 'Inv']] 
  </code></pre>
  
  <p>but I get an error </p>
  
  <p>ValueError: Can only compare identically-labeled Series objects</p>