I'm attempting to compute the Euclidean distance between two matricies which I would expect to be given by the square root of the element-wise sum of squared differences.
This seems to me to be exactly the calculation computed by numpy's linalg.norm function, however it doesn't appear to match my expected result.
For example this code returns different values (5.385 vs 5.339)
import numpy as np
a = np.arange(6).reshape(2, 3)
b = np.array([[1,2,3], [-1,1,4]])
print(np.sqrt(np.sum(np.square(a-b))))
print(np.linalg.norm(a-b, 2))
Have I misinterpreted the linalg.norm function? Why are the two above calculation methodologies not returning the same value?