title: (Python) RuntimeWarning: invalid value encountered in double_scalars """
body: <p>Good Evening,</p>
  
  <p>I am beginner in Python and learning some new things daily.
  This time i am incurring a problem while executing the following code:</p>
  
  <pre><code>distance = [np.nan]
  speed = [np.nan]
  for i in range(1,len(data)):
      distance_dt = distance_cal(data.loc[i-1,'latitude'],data.loc[i-1,'longitude'],data.loc[i,'latitude'],data.loc[i,'longitude'])
  speed_dt = distance_dt/(data.loc[i,'delta_time']/3600)
  distance.append(distance_dt)
  speed.append(speed_dt)
  data['distance'] = np.around(distance, decimals=6)
  data['speed'] = np.around(speed, decimals=6)
  </code></pre>
  
  <p>Generated Error is:</p>
  
  <p>C:...site-packages\ipykernel_launcher.py:5: RuntimeWarning: invalid value encountered in double_scalars
    """
  C:...site-packages\ipykernel_launcher.py:5: RuntimeWarning: divide by zero encountered in double_scalars
    """</p>
  
  <p>I have checked  </p>
  
  <blockquote>
    <p>\ipykernel_launcher.py 'It's code is given below'.</p>
  </blockquote>
  
  <pre><code>"""Entry point for launching an IPython kernel.
  
  This is separate from the ipykernel package so we can avoid doing import until
  after removing the cwd from sys.path.
  """
  
  import sys
  
  if __name__ == '__main__':
      # Remove the CWD from sys.path while we load stuff.
      # This is added back by InteractiveShellApp.init_path()
      if sys.path[0] == '':
          del sys.path[0]
  
      from ipykernel import kernelapp as app
      app.launch_new_instance()
  </code></pre>
  
  <p>Moreover, distance and speed are two variables/datsets present in excel and contain value either 0,1 or floating number.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thank you.</p>