I am trying to iterate through the "cutoff" parameter of the difflib.get_close_matches using the following code:
import difflib
from numpy import loadtxt
text_file = open('filewithtext.txt', "r")
lines = text_file.read().split(',')
word = 'word_to_search_in_file'
for i in range(0,0.4):
difflib.get_close_matches(word, lines, n=10, cutoff=i)
I get the following error:
TypeError Traceback (most recent call last)
<ipython-input-224-a5dc535e6b28> in <module>()
2 word = 'word_to_search_in_file'
3
----> 4 for i in range(0,0.4):
5 difflib.get_close_matches(word, lines, n=10, cutoff=i)
TypeError: 'float' object cannot be interpreted as an integer
My question is - how can iterate through the cutoff parameter, to get the function runs for a list of numbers assigned to the cutoff
Thanks.