Is it possible to filter array without creating new columns?
For example i have this dataframe:
userID goalsID
25 [1,2,4,5]
188 [3,6]
79 [1,9]
How to filter array by digit "3" in column "goalsID"? I need this result:
userID goalsID
188 [3,6]
I was trying to transfer data to new columns, but i want to know - is it possible to filter array?
out = df[[3 in l for l in df['goalsID']]