I have a big list of strings where some elements are substrings of other elements. For example:
list = ['car', 'cartesian', ...]
I want to check if any element of my list is present in a column of a pandas dataframe, but I want to get a match that corresponds to a whole string and not to a substring. For example, if a row in the column has this value:
'carmine is a pigment'
I don't want a match: carmine-car
Right now I'm applying the solution here:
Pandas str.contains - Search for multiple values in a string and print the values in a new column
but I'm getting partial matches.
Thanks!