Context
I have a Pandas DataFrame and would like to filter it by only including Rows that contain any String from a given List. However, I can't find a solution in the Pandas Documentation.
Code
DataFrame
ID Names
0 'NameA NameB'
1 'NameB'
2 'NameB NameC'
3 'NameC'
data: pandas.DataFrame = ...
names = ['NameA', 'NameC']
filteredData = data.filter ... # ?
In this example, when filtering, only the
RowwithID = 1should be removed, since it does not contain one the definedNames.
Question
- How can I achieve the described goal above?