title: Concise method to get corresponding columns for a query based selection in pandas
body: <p><a href="https://i.stack.imgur.com/fDOF2.png" rel="nofollow noreferrer">Current plot and anticipated plot</a></p>
  
  <p>Im new to python. I'm trying to get a subset of the housing index dataset from <a href="https://github.com/ageron/handson-ml/blob/master/02_end_to_end_machine_learning_project.ipynb" rel="nofollow noreferrer">https://github.com/ageron/handson-ml/blob/master/02_end_to_end_machine_learning_project.ipynb</a></p>
  
  <p>I have imported the dataset as 'housing'. I am trying to plot just the outliers in quantile 0.95 on top of the plot which shows all the values for median_house_value</p>
  
  <pre><code>import matplotlib.image as mpimg
  
  housing.plot(kind="scatter", x="median_income", y="median_house_value",
               alpha=0.1)
  </code></pre>
  
  <p>this gets a plot of all the rows (i), i am trying to select the corresponding median_income rows for the subset of median_house_value that is the 0.95 quantile and plot them over the top in orange (j)</p>
  
  <p>Below is my best attempt so far, which is not getting the correct values</p>
  
  <pre><code>plt.plot(housing.groupby('median_house_value').quantile(q=quant)["median_income"], housing.groupby('median_house_value').quantile(q=quant).index.get_level_values('median_house_value'),"or")
  </code></pre>
  
  <p>I can get the median_house_value rows in the quantile by doing..</p>
  
  <pre><code>quantile = int(round(housing["median_house_value"].quantile(q=0.95)))
  housing.median_house_value &gt; quantile
  </code></pre>
  
  <p>I want to end up with two panda arrays, one for the x axis, an array of median_income rows that correspond to the second array which would be an array of median_house_value rows that make up the quantile</p>
  
  <p>Thanks in advance.</p>