userID goalsID
25 [1,2,4,5]
188 [3,6]
79 [1,9]
userID goalsID
188 [3,6]
df = pd.DataFrame({
'userID':[25,188,79],
'goalsID':[[1,2,4,5],[3,6],[1,9]]
})
(
df.loc[lambda x:x['goalsID'].apply(lambda x: 3 in x)]
)