// construct an array of names
docs_np_name = np.asarray([temp_labels[i] for i in other_file_indexes])
docs_np = np.column_stack((docs_np_name, docs_np_score))
// sort by score
sorted_docs_np = docs_np[docs_np[:, 1].argsort()]
// extract the array of name and score out from sorted_docs_list
docs_name = sorted_docs_np[:, 0]
docs_score = np.round(sorted_docs_np[:, 1].astype(float), decimals=4)
After Change
final_score_array = np.round(sorted_score_array, decimals=4)
// sort the
final_name_array = docs_name_array[docs_score_array.argsort()]
// pack the scores and names in data_frame
score_name_data_frame = pd.DataFrame(final_score_array,
index=final_name_array,