回答編集履歴
1
書式の改善
test
CHANGED
@@ -42,8 +42,8 @@
|
|
42
42
|
|
43
43
|
ind_xr = np.empty_like(xr, dtype=int)
|
44
44
|
for i, xi in enumerate(xr):
|
45
|
-
|
45
|
+
n = bisect_left(xl, xi)
|
46
|
-
ind_xr[i] =
|
46
|
+
ind_xr[i] = n - 1 if xl[n] - xi > xi - xl[n - 1] else n
|
47
47
|
|
48
48
|
np.set_printoptions(suppress=True)
|
49
49
|
print(xl[ind_xr] - xr)
|