So far I am getting the index of first matching record for a particular value in the Python data frame column. I get it using the code below :
df1.loc[df1.Column1 == 'word1'].index.tolist()[0]
Suppose if 'word1' is present four times in the data frame for example in the index positions : 3, 7, 9, 14, the above command will return me the answer as 3
Now I need to check the same with multiple values for the column and the output should be the first matching index of any of those values.
I tried with few options as shown below but in vain.
df1.loc[df1.Column1 == 'word1'|'word2'].index.tolist()[0]
df1.loc[df1.Column1 == 'word1','word2'].index.tolist()[0]
df1.loc[df1.Column1 == 'word1' or 'word2'].index.tolist()[0]
Any idea on how to check for multiple values here ?