title: How do i select objects within a geographic regions in a pandas dataframe
body: <p>I'm trying to selection objects within a region from a pandas dataframe which contains a list of item ids and lat lon pairs. Is there a selection method for this?
  I think this would be similar to this SO question but using PANDAS instead of SQL</p>
  
  <p><a href="https://stackoverflow.com/questions/550445/selecting-geographical-points-within-area">Selecting geographical points within area</a></p>
  
  <p>Here is my table saved in <em>locations.csv</em></p>
  
  <pre><code>ID, LAT, LON
  001,35.00,-75.00
  002,35.01,-80.00 
  ...
  999,25.76,-64.00
  </code></pre>
  
  <p>I can load the dataframe, and select a rectangular region:</p>
  
  <pre><code>import pandas as pd
  df = pd.read_csv('locations.csv', delimiter=',')
  lat_max = 32.323496
  lat_min = 25.712767
  lon_max = -72.863358
  lon_min = -74.729456
  small_df = df[df['LAT'] &gt; lat_min][df['LAT'] &lt; lat_max][df['LON'] &lt; lon_max][df['LON'] &gt; lon_min]
  </code></pre>
  
  <p>How would I select objects within an irregular region? </p>
  
  <p>How would I structure the dataframe selection command?</p>
  
  <p>I can build a lambda function that will produce a True value for LAT and LON within the region but I'm not sure how to use that with a pandas dataframe. </p>