Python numpy 点数组去重
废话不多说,直接上代码,有详细注释
# coding = utf-8
import numpy as np
from IPython import embed
# xy 输入,可支持浮点数操作 速度很快哦
# return xy 去重后结果
def duplicate_removal(xy):
if xy.shape[0] < 2:
return xy
_tmp = (xy*4000).astype('i4')
# coding = utf-8
import numpy as np
from IPython import embed
# xy 输入,可支持浮点数操作 速度很快哦
# return xy 去重后结果
def duplicate_removal(xy):
if xy.shape[0] < 2:
return xy
_tmp = (xy*4000).astype('i4')