python - Fuzzy-match List of People -


i trying see if movie same between 2 pages, , compare actors 1 of criteria. however, actors listed differently on different pages. example:

previously, doing rough match on:

if actors_from_site_1[0] == actors_from_site_2[0] 

but, can see above case, isn't technique. better technique see if actors 1 film match others?

you check length of set intersection of 2 sets of actors.

if len(set(actors_from_site_1).intersection(set(actors_from_site_2))): 

or like:

if any(actor in actors_from_site_1 actor in actors_from_site_2): 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -