title: Extract rows from pandas Dataframe based on column value
body: <p>How would I go about extracting rows where a column matches a specific value from a Dataframe created from an excel file?</p>
  
  <p>Here are few rows from the Dataframe:</p>
  
  <pre><code>    Food            Men     Women
  0   Total fruit     86.20   88.26
  1   Apples, Total   89.01   89.66
  2   Apples as fruit 89.18   90.42
  3   Apple juice     88.78   88.42
  4   Bananas         95.42   94.18
  5   Berries         84.21   81.73
  6   Grapes          88.79   88.13
  </code></pre>
  
  <p>and this is the code that I used to read the excel file, choosing the columns I needed and renaming them appropriately:</p>
  
  <pre><code>data1= pd.read_excel('USFoodCommodity.xls', sheetname='94-98 FAH', skiprows=76,skip_footer=142, parse_cols='A, H, K')
  data1.columns = ['Food', 'Men', 'Women']
  
  # Try 1: data1 = data1[data1['Food'].isin(['Total fruit']) == True] works
  # Try 2: data1 = data1[data1['Food'].isin(['Apple, Total']) == True] doesn't work
  # Try 3: data1 = data1.iloc[[1]] returns Apples, Total but not appropriate to use integer index
  # Try 4: data1[data1['Food'] == 'Berries'] doesn't work
  </code></pre>
  
  <p>So far based on the answers such as <a href="https://stackoverflow.com/questions/14057007/remove-rows-not-isinx">this</a>, <a href="https://stackoverflow.com/questions/16096627/pandas-select-row-of-data-frame-by-integer-index">this</a>, or <a href="https://stackoverflow.com/questions/17071871/select-rows-from-a-dataframe-based-on-values-in-a-column-in-pandas">here</a> I have only been able to return the first index where Food = "Total fruit". When I try the other methods above I only get the column names such as:</p>
  
  <pre><code>Food    Men Women
  </code></pre>
  
  <p>I am new to pandas and can't see where I am going wrong. Why can I extract the first row where Food == Total fruit but not anything else?</p>