Need to search a string column values from a list of strings. The strings in the search list are only a substring of the values in the column
df = pd.DataFrame(data={'text':['abc def', 'def ghi', 'poi opo', 'aswwf', 'abcs sd'], 'id':[1, 2, 3, 4, 5]})
Out [1]:
text id
0 abc def 1
1 def ghi 2
2 poi opo 3
3 aswwf 4
4 abcs sd 5
search = ['abc', 'poi']
Required:
Out [2]:
text id
0 abc def 1
1 poi opo 3
2 abcs sd 5