回答編集履歴
1
d
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
|
```
|