I am trying to calculate the Euclidean Distance between two datasets in python. I can do this using the following:
np.linalg.norm(df-signal)
With df and signal being my two datasets.
This returns a single numerical value (i.e, 8258155.579535276), which is fine.
My issue is that I want it to return the difference between each column in the dataset. Something like this:
AFNLWGT 4.867376e+10
AGI 3.769233e+09
EMCONTRB 1.202935e+07
FEDTAX 8.095078e+07
PTOTVAL 2.500056e+09
STATETAX 1.007451e+07
TAXINC 2.027124e+09
POTHVAL 1.158428e+08
INTVAL 1.606913e+07
PEARNVAL 2.038357e+09
FICA 1.080950e+07
WSALVAL 1.986075e+09
ERNVAL 1.905109e+09
I'm fairly new to Python so would really appreciate any help possible.
np.linalg.norm. For column-wise distance useaxis=0.