How to optimize calculation of distance between all the rows of dataframe?

前端 未结 0 2017
无人共我
无人共我 2020-12-04 15:46
def get_distance(v1, v2):
    total_distance = 0
    x = v1; y = v2
    s = 1 - np.absolute(x - y) 
    total_distance = np.nansum(s) 
    return total_distance


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题