Избегайте цикла Python for. В numy это просто:
>>> profile[:, None] - profile[None, :]
array([[ 0. , 8.38429017, 0.77368494, 9.77058453, 2.32283325],
[-8.38429017, 0. , -7.61060524, 1.38629436, -6.06145692],
[-0.77368494, 7.61060524, 0. , 8.9968996 , 1.54914832],
[-9.77058453, -1.38629436, -8.9968996 , 0. , -7.44775128],
[-2.32283325, 6.06145692, -1.54914832, 7.44775128, 0. ]])