How duplicated items can be deleted from dataframe in pandas
The best way would be to use drop_duplicates(). If you have a larger DataFrame and only want those two columns checked, set subset equal to the combined columns you want checked.

df = df.drop_duplicates()


or

df = df.drop_duplicates(subset=['userid', 'itemid'])