回答編集履歴
1
コード修正
test
CHANGED
@@ -26,18 +26,28 @@
|
|
26
26
|
|
27
27
|
taiju, sintyo = u
|
28
28
|
|
29
|
-
ct = get_class( taiju, [50,60,70], le) # 以下
|
30
29
|
|
30
|
+
|
31
|
+
range_t = [50,60,70]
|
32
|
+
|
33
|
+
ct = get_class( taiju, range_t, le) # 以下
|
34
|
+
|
35
|
+
range_s = [160,180]
|
36
|
+
|
31
|
-
cs = get_class( sintyo,
|
37
|
+
cs = get_class( sintyo, range_s, lt) # 未満
|
32
38
|
|
33
39
|
return ct, cs
|
34
40
|
|
41
|
+
#return cs * (len(range_t)+1) + ct # スカラー値(0...11)でクラス分けしたいならこちら
|
35
42
|
|
36
43
|
|
37
|
-
print(bunseki((40,150)))#(0, 0)
|
38
44
|
|
39
|
-
print(bunseki((
|
45
|
+
print(bunseki((40,150)))#(0, 0) or 0
|
40
46
|
|
47
|
+
print(bunseki((60,170)))#(1, 1) or 5
|
48
|
+
|
41
|
-
print(bunseki((80,180)))#(3, 2)
|
49
|
+
print(bunseki((80,180)))#(3, 2) or 11
|
50
|
+
|
51
|
+
|
42
52
|
|
43
53
|
```
|