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