Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -56,12 +56,9 @@ def recommend_movies(movie):
|
|
56 |
max_length = movies['title'].str.len().max()
|
57 |
print(f"The longest movie name length is: {max_length}")
|
58 |
|
59 |
-
|
60 |
-
|
61 |
|
62 |
-
format_string = f"{{:<{max_length}}}: {{:>5.2f}}"
|
63 |
-
return "Title" + " " * (max_length - 5) + "Score\n" + "\n".join([format_string.format(title, score) for title, score in recommendations])
|
64 |
-
|
65 |
|
66 |
# Create the Gradio interface
|
67 |
movie_list = movies['title'].tolist()
|
|
|
56 |
max_length = movies['title'].str.len().max()
|
57 |
print(f"The longest movie name length is: {max_length}")
|
58 |
|
59 |
+
headers = "Score{:10}Title".format("")
|
60 |
+
return headers + "\n" + "\n".join([f"{score:>5.2f} {title:<20} " for title, score in recommendations])
|
61 |
|
|
|
|
|
|
|
62 |
|
63 |
# Create the Gradio interface
|
64 |
movie_list = movies['title'].tolist()
|