movie_title = input("Enter the name of the movie: ")try: movie_index = data.index.get_loc(movie_title) print("Index of the movie '{}' in the dataset: {}".format(movie_title, movie_index))except KeyError: print("Movie '{}' not found in the dataset.".format(movie_title))
I'm trying to find a movie title in my dataset, despite the title being in the dataset, the output is
Enter the name of the movie: 300 (2007)Movie '300 (2007)' not found in the dataset.
I need this for recommender system urgently.
I tried stripping the string, converting it to lower case,