回答編集履歴
2
修正
test
CHANGED
@@ -14,8 +14,12 @@
|
|
14
14
|
|
15
15
|
"D行idx番目に1を入れる"
|
16
16
|
|
17
|
+
df.iat[3, idx] = 1
|
18
|
+
|
17
19
|
else:
|
18
20
|
|
19
21
|
"D行idx番目に-1を入れる"
|
20
22
|
|
23
|
+
df.iat[3, idx] = -1
|
24
|
+
|
21
25
|
```
|
1
修正
test
CHANGED
@@ -1,15 +1,21 @@
|
|
1
1
|
```Python
|
2
2
|
|
3
|
-
|
3
|
+
import itertools
|
4
4
|
|
5
|
-
#df_gc に TrueかFalseが入る
|
6
5
|
|
7
|
-
if df_gc:
|
8
6
|
|
9
|
-
d
|
7
|
+
idx_list = [idx for nums1, idx in enumerate("B行の数値たち")]
|
10
8
|
|
11
|
-
else:
|
12
9
|
|
10
|
+
|
11
|
+
for lft, rght, idx in itertools.product("B行の数値たち", "C行の数値たち", idx_list):
|
12
|
+
|
13
|
+
if float(lft) > float(rght):
|
14
|
+
|
15
|
+
"D行idx番目に1を入れる"
|
16
|
+
|
13
|
-
|
17
|
+
else:
|
18
|
+
|
19
|
+
"D行idx番目に-1を入れる"
|
14
20
|
|
15
21
|
```
|