File size: 381 Bytes
c8e0175 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import pandas as pd
import numpy as np
def find_similar(p_index, similarity_matrix, projects_df, top_x):
selected_row = similarity_matrix[p_index]
top_indexes = np.argsort(selected_row)[-10:][::-1]
top_values = selected_row[top_indexes]
top_projects_df = projects_df.iloc[top_indexes]
top_projects_df["similarity"] = top_values
return top_projects_df
|