Code:
texto = ['El', 'enfermo', 'grave', 'habla', 'de', 'trasplantes', '.']
for palabra in texto:
filtro = data[data['palabra'].str.match(palabra, case=False )]
print(filtro)
An extract of the answer I get from the dataframe is:
palabra tag
374 el DA0MS0
389 el DA0MS0
398 elementos NCMP000
What I need is that only the exact word "the" in this case, also filter all the words that contain "the" at the beginning as the word "elements" in the example.
Expected response:
palabra tag
374 el DA0MS0
389 el DA0MS0