I have a list and pandas dataframe data that looks like this:
user_id = [10, 15, 20, 25, 30, 32, 40, 45, 50] user_id value 10 45 20 49 25
Use a set operation:
list(set(user_id)-set(df.user_id)) Out[84]: [40, 50, 45, 15]