title: Distance calculation in pandas dataframe with two lat columns and two long columns
body: <p>I have a pandas Dataframe df with these 4 colums :</p>
  
  <ul>
  <li>pickup_latitude</li>
  <li>pickup_longitude</li>
  <li>dropoff_latitude</li>
  <li>dropoff_longitude</li>
  </ul>
  
  <p>And I want to create a new column with the distance between the pickup and the dropoff point. </p>
  
  <p>I created this function : </p>
  
  <pre><code>def calcul_de_distance_vol_oiseau(data):
  
  R = 6373.0
  
  """ je change les variables en radians car python parle en radian et pas en degrées """
  data['pickup_longitude'] = data['pickup_longitude'].apply(radians)
  data['pickup_latitude'] = data['pickup_latitude'].apply(radians)
  data['dropoff_longitude'] = data['dropoff_longitude'].apply(radians)
  data['dropoff_latitude'] = data['dropoff_latitude'].apply(radians)
  
  data['diff_lon'] = data['dropoff_longitude'] - data['pickup_longitude']
  data['diff_lat'] = data['dropoff_latitude'] - data['dropoff_latitude']
  
  data['calcul_intermediaire']= (data['diff_lat'] / 2).apply(sin)**2 + data['pickup_latitude'].apply(cos) * data['dropoff_latitude'].apply(cos) * (data['diff_lon'] / 2).apply(sin)**2
  
  data['distance'] = R*np.arctan2((data['calcul_intermediaire']).apply(sqrt),(1 - data['calcul_intermediaire']).apply(sqrt))
  
  return data
  </code></pre>
  
  <p>But when I want to verify the distance between my points, I don't have the same result as in this website <a href="https://www.sunearthtools.com/fr/tools/distance.php" rel="nofollow noreferrer">https://www.sunearthtools.com/fr/tools/distance.php</a> which calcul distance between gps points.
  I think there is a mathematical error in my function but I didn't find where.</p>
  
  <p>Thanks in advance</p>