The code below is used to calculate the inner product of two vectors, but sometimes it returns wrong values and I don't know why. Can anyone help me with this problem?
Specifically for these inputs: [-2.328, -7.284, -1.214] and [-1.821, 1.072, -2.94]
reduce(lambda x,y : x+y, [x*y for x,y in zip(self.coordinates, v.coordinates)])