IIUC重新创建您的df,然后使用
isinwith
any应该比
apply
df[pd.Dataframe(df.species.tolist()).isin(selection).any(1).values]Out[64]: molecule species0 a [dog]2 c [cat, dog]3 d [cat, horse, pig]

IIUC重新创建您的df,然后使用
isinwith
any应该比
apply
df[pd.Dataframe(df.species.tolist()).isin(selection).any(1).values]Out[64]: molecule species0 a [dog]2 c [cat, dog]3 d [cat, horse, pig]