Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

find the most similar rows in two dataframes

import scipy
ary = scipy.spatial.distance.cdist(df2, df1, metric='euclidean')
df2[ary==ary.min()]
Out[894]: 
     A   B   C   D
14  16  66  83  13
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #similar #rows #dataframes
ADD COMMENT
Topic
Name
7+7 =