Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def find_neighbor_titles(movies, indices):
- titles = indices.copy()
- K = indices.shape[1]
- for i in range(K):
- titles = titles.merge(movies[['title']], left_on=i, right_index=True, how="left")
- titles = titles.rename(columns={'title': 'title_{}'.format(i+1)})
- return titles.drop(list(range(K)), axis=1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement