Quantcast
Viewing all articles
Browse latest Browse all 14069

String not being found in the dataset

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,


Viewing all articles
Browse latest Browse all 14069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>