回答編集履歴

3

Update

2021/11/26 20:46

投稿

melian
melian

スコア20655

test CHANGED
@@ -60,7 +60,7 @@
60
60
 
61
61
  arr = np.array(lst, dtype=object)
62
62
 
63
- print(arr[np.where(arr[:,1] == np.min(arr[:,1]))])
63
+ print(arr[arr[:,1] == np.min(arr[:,1])])
64
64
 
65
65
 
66
66
 

2

Update

2021/11/26 20:46

投稿

melian
melian

スコア20655

test CHANGED
@@ -58,7 +58,7 @@
58
58
 
59
59
 
60
60
 
61
- arr = np.array(lst)
61
+ arr = np.array(lst, dtype=object)
62
62
 
63
63
  print(arr[np.where(arr[:,1] == np.min(arr[:,1]))])
64
64
 

1

Update

2021/11/26 20:17

投稿

melian
melian

スコア20655

test CHANGED
@@ -47,3 +47,27 @@
47
47
  [(30, 40, 54), (30, 50, 54)]
48
48
 
49
49
  ```
50
+
51
+
52
+
53
+ ちなみに `Numpy` を使うと以下の様になります。
54
+
55
+ ```python
56
+
57
+ import numpy as np
58
+
59
+
60
+
61
+ arr = np.array(lst)
62
+
63
+ print(arr[np.where(arr[:,1] == np.min(arr[:,1]))])
64
+
65
+
66
+
67
+ #
68
+
69
+ [[(30, 40, 54) 35]
70
+
71
+ [(30, 50, 54) 35]]
72
+
73
+ ```