回答編集履歴

1

d

2022/01/26 17:25

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -30,7 +30,7 @@
30
30
  # loc1 の行ごとに、距離が最短の loc2 の行のインデックスを求める。
31
31
  nearest_idx = np.argmin(dist_matrix, axis=1)
32
32
 
33
- # 結合する。
33
+ # 横方向に結合する。
34
34
  df3 = pd.concat((df1, df2.iloc[nearest_idx].reset_index()), axis=1)
35
35
  print(df3)
36
36
  ```