def set_difference(a, b):
assert a.shape[1:] == b.shape[1:]
a = a.copy()
b = b.copy()
a_v = a.view([('', a.dtype)] * a.shape[1])
b_v = b.view([('', b.dtype)] * b.shape[1])
return np.setdiff1d(a_v, b_v).view(a.dtype).reshape((-1, a.shape[1]))
评论列表
文章目录