Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -30,6 +30,9 @@ indices = pd.Series(movies.index, index=movies['title']).drop_duplicates()
|
|
30 |
|
31 |
# Function that takes in movie title as input and outputs most similar movies
|
32 |
def get_recommendations(title, cosine_sim=cosine_sim):
|
|
|
|
|
|
|
33 |
# Get the index of the movie that matches the title
|
34 |
idx = indices[title]
|
35 |
|
|
|
30 |
|
31 |
# Function that takes in movie title as input and outputs most similar movies
|
32 |
def get_recommendations(title, cosine_sim=cosine_sim):
|
33 |
+
if not title:
|
34 |
+
return "No movie selected. Please select one from the dropdown."
|
35 |
+
|
36 |
# Get the index of the movie that matches the title
|
37 |
idx = indices[title]
|
38 |
|