1
我使用下面的代碼片段來獲取唯一數組的列表,但它以一種奇怪的方式重新排列列表。 uniquecoords
每次都必須是相同的順序還是有任何隨機因素?numpy獨一無二總是一樣嗎?
for c in coordiantes:
coords.extend(c)
a = np.array(coords)
uniquecoords = np.unique(
a.view(
np.dtype((np.void, a.dtype.itemsize*a.shape[1])))
).view(a.dtype).reshape(-1, a.shape[1])