title: Develop Euclidean distance in for loop in data frame
body: <p>I am trying to calculate the Euclidean distance between two columns in data frames. Compare the first row with the rest rows to get the distance.</p>
  <p>This is my code so far:</p>
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import math
  import numpy as np
  
  data = pd.read_csv(&quot;Data_HW1.csv&quot;)
  
  dist = []
  for i in range(0, len(data)):
      dist = ((data.iloc[0, 0] - data.iloc[i, 0]) ** 2 + (data.iloc[0, 1] - data.iloc[1, i]) ** 2)
      print((dist) ** (1 / 2))
  </code></pre>
  <p>It gives me list error index out of range. I am also trying to get a new column with the new distance values between the first row and the rest of them.</p>