質問編集履歴

2

日本語修正

2021/03/24 16:26

投稿

mini1988
mini1988

スコア56

test CHANGED
File without changes
test CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  for i in range(x1.shape[1]):
22
22
 
23
- if x1.min(axis=0)[i] > x2[k,i] and x2[k,i] > x1.max(axis=0)[i]:
23
+ if x1.min(axis=0)[i] > x2[k,i] or x2[k,i] > x1.max(axis=0)[i]:
24
24
 
25
25
  err_idx.append(k)
26
26
 
@@ -44,7 +44,7 @@
44
44
 
45
45
  data_min=x1.min(axis=0)
46
46
 
47
- err_idx=[k for k in range(len(x2)) for i in range(x1.shape[1]) if data_min[i] > x2[k,i] and x2[k,i] > data_max[i]]
47
+ err_idx=[k for k in range(len(x2)) for i in range(x1.shape[1]) if data_min[i] > x2[k,i] or x2[k,i] > data_max[i]]
48
48
 
49
49
  return sorted(list(set(err_idx)))
50
50
 

1

説明追加

2021/03/24 16:26

投稿

mini1988
mini1988

スコア56

test CHANGED
File without changes
test CHANGED
@@ -6,9 +6,13 @@
6
6
 
7
7
 
8
8
 
9
+ 案1
10
+
11
+
12
+
9
13
  ```ここに言語を入力
10
14
 
11
- def _judge(x1, x2):
15
+ def _judge(x1, x2): ### x1:データベースのデータ, x2:判定するデータセット
12
16
 
13
17
  err_idx=[]
14
18
 
@@ -25,3 +29,23 @@
25
29
  return sorted(list(set(err_idx)))
26
30
 
27
31
  ```
32
+
33
+
34
+
35
+ 案2
36
+
37
+
38
+
39
+ ```ここに言語を入力
40
+
41
+ def _judge(x1, x2): ### x1:データベースのデータ, x2:判定するデータセット
42
+
43
+ data_max=x1.max(axis=0)
44
+
45
+ data_min=x1.min(axis=0)
46
+
47
+ err_idx=[k for k in range(len(x2)) for i in range(x1.shape[1]) if data_min[i] > x2[k,i] and x2[k,i] > data_max[i]]
48
+
49
+ return sorted(list(set(err_idx)))
50
+
51
+ ```