[Numpy-discussion] Distance Matrix speed

Alex Cannon acannon at gmail.com
Sat Jun 17 16:41:15 CDT 2006


How about this?

def d5():
    return add.outer(sum(A*A, axis=1), sum(B*B, axis=1)) - \
                            2.*dot(A, transpose(B))




More information about the Numpy-discussion mailing list