回答編集履歴
1
コード修正
test
CHANGED
@@ -42,7 +42,13 @@
|
|
42
42
|
|
43
43
|
print(a.shape) # (2268000,)
|
44
44
|
|
45
|
+
# 並びを維持したままダブりを消す
|
46
|
+
|
47
|
+
# https://stackoverflow.com/questions/15637336/numpy-unique-with-order-preserved
|
48
|
+
|
45
|
-
|
49
|
+
_, idx = np.unique(a, return_index=True)
|
50
|
+
|
51
|
+
a = a[np.sort(idx)]
|
46
52
|
|
47
53
|
print(a.shape) # (1138501,)
|
48
54
|
|