I am a noob in terms of Machine Learning. I am trying to program a K nearest neighbor algorithm, but I got an error for my array.
<ipython-input-206-78dc8182727c> in euclidean_distance(p1, p2)
1 #Use pythagorean theorem to calculate distance between two points
2 def euclidean_distance(p1,p2):
----> 3 return np.sqrt(np.sum((p1-p2))**2)
ValueError: operands could not be broadcast together with shapes (4,) (2,)
Can someone help me in understanding and solving this problem? Thanks in advance.