Cosine Similarity rows in a dataframe of pandas
问题 I have a CSV file which have content as belows and I want to calculate the cosine similarity from one the remaining ID in the CSV file. I have load it into a dataframe of pandas as follows: old_df['Vector']=old_df.apply(lambda row: np.array(np.matrix(row.Vector)).ravel(), axis = 1) l=[] for a in old_df['Vector']: l.append(a) A=np.array(l) similarities = cosine_similarity(A) The output looks fine. However, i do not know how to find which the GUID (or ID)similar to other GUID (or ID), and I