I have a Pandas Series of lists of arbitary length:
s = pd.Series([[1,2,3], [4,6], [7,8,9,10]])
and a list of elements
l = [1,2,3,6,7,8]
I want to return all elements of the series s which has all values contained in l, otherwise None. I want to do something like this but apply it to each element in the series:
s.where(s.isin(l), None)
So the output would be a series:
pd.Series([[1,2,3], None, None])