title: Get max value of column for rows where a condition is met
body: <p>I have a DataFrame that looks like this:</p>
  
  <pre><code>| Age | Married | OwnsHouse |
  | 23  | True    | False     |
  | 35  | True    | True      |
  | 14  | False   | False     |
  | 27  | True    | True      |
  </code></pre>
  
  <p>I want to find the highest age of anyone who is married and owns a house. The answer here would be 35. My first thought was to do:</p>
  
  <pre><code>df_subset = df[df['Married'] == True and df['OwnsHouse'] == True]
  max_age = df_subset.max()
  </code></pre>
  
  <p>However, dataset is big (50MB) and I fear this will be computationally expensive as it goes through the dataset twice. </p>
  
  <p>My second thought was to do:</p>
  
  <pre><code>max_age = 0
  for index, row in df.iterrows():
      if(row[index]['Married] and row['index']['OwnsHouse'] and row[index]['Age] &gt; max_age):
      max_age = row[index]['Age']
  </code></pre>
  
  <p>Is there a faster way of doing this? </p>