title: Converting integer into float to calculate new values
body: <p>I created a subset of a Pandas DataFrame in Python with four columns. Then, I wanted to measure the distance from every person in the main DataFrame to the subset.</p>
  <pre><code>df_all['dist_2021'] = np.sqrt( (df_all_subset[&quot;PCA1&quot;] - df_all['PCA1'])**2)
  </code></pre>
  <p>Didn't work. Only got NaNs. I ultimately solved it by creating a new variable for every number in the subset and converting it into float. But I don't understand why that worked...</p>
  <pre><code>subset_pca1 = float(df_all[&quot;PCA1&quot;][(df_all[&quot;Player&quot;] == &quot;Jadon Sancho&quot;) &amp; (df_all[&quot;Season&quot;] == &quot;2020/2021&quot;)])
  </code></pre>
  <p>Can someone explain? Also, more generally, is this the typical way of how to subtract one dataframe from another?</p>