Spaces:
Runtime error
Runtime error
tobiasaurer
commited on
Commit
•
b0ed355
1
Parent(s):
34a675b
bugfix
Browse files
pages/1 - Popularity-Based Recommender.py
CHANGED
@@ -59,7 +59,10 @@ def get_popular_recommendations_streaming(n, genres, country, url, headers):
|
|
59 |
[['title', 'avg_rating', 'genres']]
|
60 |
)
|
61 |
# merge recommendations with links df to get imdbIds for the API calls
|
62 |
-
recommendations_ids = recommendations
|
|
|
|
|
|
|
63 |
recommendations_ids['imdbId'] = 'tt0' + recommendations_ids['imdbId'].astype('str')
|
64 |
imdb_ids = list(recommendations_ids['imdbId'])
|
65 |
|
|
|
59 |
[['title', 'avg_rating', 'genres']]
|
60 |
)
|
61 |
# merge recommendations with links df to get imdbIds for the API calls
|
62 |
+
recommendations_ids = (recommendations
|
63 |
+
.merge(movies, how = 'left', on = 'title')
|
64 |
+
.merge(links, how = 'left', on = 'movieId')[['title', 'genres', 'imdbId']]
|
65 |
+
)
|
66 |
recommendations_ids['imdbId'] = 'tt0' + recommendations_ids['imdbId'].astype('str')
|
67 |
imdb_ids = list(recommendations_ids['imdbId'])
|
68 |
|