I have got a string stored in a dataframe column
import pandas as pd
df = pd.DataFrame({"ID": 1, "content": "froyay-xcd = (E)-cut-2-froyay-xcd"}, index=[0])
print(df)
idx = df[df['content'].str.contains("froyay-xcd = (E)-cut-2-froyay-xcd")]
print(idx)
I'm trying to find the index of the row that contains a search string and the following warning occurs
UserWarning: This pattern has match groups. To actually get the groups, use str.extract.
return func(self, *args, **kwargs)
I'm not sure why an empty dataframe is returned when the search string actually is present in the dataframe columns.
Any suggestions will be highly appreciated. I expect the output to return the row stored in the dataframe.