1

Suppose I have a dataframe with an index column filled with strings. Now, suppose I have very similar but somewhat different strings that I want to use to look up rows within the dataframe. How would I do this since they aren't identical? My guess would be to simply choose the row with the lowest distance between the two strings, but I'm not really sure how I could do that efficiently.

For example, if my dataframe is:

enter image description here

and I want to lookup "Lord of the rings", I should get the 2nd row. How would I do this in pandas?

joejoejoejoe4
  • 1,206
  • 1
  • 18
  • 38
  • This may be of help https://stackoverflow.com/questions/13636848/is-it-possible-to-do-fuzzy-match-merge-with-python-pandas – piterbarg Nov 08 '20 at 15:35

0 Answers0