Finding object in a list which contains certain word

hi, there is lots of answers in similar topic but i cant implement any of them in my situation. so please help me to find solution?

i have a list that contains sentences like:

mylist=(“updat review purchas towel”," spite mix review pictur damag “,“towel one reason low price point set towel “,“anoth slightli larger bath towel x standard “,”…”,”…”,”…") it has 20000 strings

and i want to search “reason” word in mylist and find index of it. in my example lets say it is (3,44,134). and then find value of my another lists which index is (3,44,134)

a was able to do it with saparete all my list and check with word by word into for loop. but i am sure there is a much more easy way.

thank you

What does (3, 44, 134) mean as an index?

If you have a list like this:

mylist = ['update review purchase towel',
          'spite mix review picture damage',
          'towel one reason low price point set towel']

how do you get an index of (3, 44, 134) for “reason”?

If I run this:

for index, sentence in enumerate(mylist):
    if 'reason' in sentence:
        offset = sentence.find('reason')
        print(index, offset)

I can see how to get index = 2 and the offset = 10. But I can’t see how
to get (3, 44, 134).

actually i have much more bigger mylist. bu i didnt write it all of them because not confuse you. mylist size 20000x13 dataframe. so i can have (3,44,134) . i was able to do it by saparete all my list and check with word by word into for loop. but i am sure there is a much more easy way

How are you getting a three dimensional index from a two dimensional
matrix?

Your matrix is:

sentence
sentence
sentence

and each sentence is:

word word word word

so it takes two coordinates to specify the index of a word: which
sentence (the row), and which word in that sentence (the column).

So I don’t see how you are getting an index that needs THREE
coordinates: (3, 44, 134). It doesn’t matter how big the matrix is,
where is the third dimension coming from?

If you think there is an easier way, why don’t you show us the code you
are using and we might be able to suggest an improvement.