title: How to find values between two radii in a CSV file
body: <p>I have a csv file that has columns named Longitude, Latitude, and Value. It looks like this:</p>
  
  <pre><code>Time                 Longitude      Latitude    SSHA
  11/22/2013 8:57     -123.603607     81.377536   0.348
  11/22/2013 8:57     -124.017502     81.387791   0.386
  11/22/2013 8:57     -124.432344     81.397611   0.383
  11/22/2013 8:57     -124.848099     81.406995   0.405
  11/22/2013 8:57     -125.264724     81.415942   --
  ...                  ...            ...         ...
  </code></pre>
  
  <p>I am interested in finding values that lie between 0.5 and 0.25 longitude/latitude of the point (-71, 40). Here is my current code that results in an error.</p>
  
  <pre><code>import pandas as pd
  import numpy
  import math
  df = pd.read_csv(r"C:\\Users\\pathexample\\documents\\folder1\\csvfile.csv")
  df1 = df[((df[['Longitude','Latitude']] - [-71, 40])**2).sum(axis=1) &lt; 0.5**2]
  df2 = df[((df[['Longitude','Latitude']] - [-71, 40])**2).sum(axis=1) &lt; 0.25**2]
  df[~(df1|df2)].to_csv(r"C:\\Users\\pathexample\\documents\\folder1\\csvfile.csv")
  </code></pre>
  
  <p>I am using the Pythagorean theorem to retain rows of the csv file that lies within 0.5 lon/lat of the point of interest and deleting all other rows with the code 
  <code>df1 = df[((df[['Longitude','Latitude']] - [-71, 40])**2).sum(axis=1) &lt; 0.5**2]</code>. 
  For example, the code below would take the csv file and remove any rows that is not within 0.5 lon/lat of the point (-71,40).</p>
  
  <pre><code>df = pd.read_csv((r"C:\\Users\\pathexample\\documents\\folder1\\csvfile.csv")
  df = df[((df[['Longitude','Latitude']] - [-71, 40])**2).sum(axis=1) &lt; 0.5**2]
  df.to_csv(r"C:\\Users\\pathexample\\documents\\folder1\\csvfile.csv")
  </code></pre>
  
  <p>The above mentioned code works and I am trying to combine two versions of this code and getting values between 0.5 and 0.25 lon/lat of the point of interest using <code>df[~(df1|df2)].to_csv()</code>. However, this part does not work as intended. I get the error, "unsupported operand type(s) for |: 'str' and 'bool'". How would I modify this?</p>