numpy數組去重重復元素
data = np.array([[1,8,3,3,4], [1,8,9,9,4], [1,8,3,3,4]]) #刪除整個數組的重復元素 uniques = np.unique(data) print( uniques) array([1, 3, 4, 8, 9]) #刪除重復行 uniques = np.unique(data,axis=0) print( uniques) array([[1,8,3,3,4], [1,8,9,9,4]]) #刪除重復列 uniques = np.unique(data,axis=1)