How duplicated items can be deleted from dataframe in pandas I have the following data:

userid itemid
  1       1
  1       1
  1       3
  1       4
  2       1
  2       2
  2       3


How can I drop duplicated items (not the index) to make the following DataFrame:

userid itemid
  1       1
  1       3
  1       4     
  2       1
  2       2
  2       3


Can someone help me?

import pandas as pd    
df = pd.DataFrame({'userid':[1,1,1,1, 2,2,2],
                   'itemid':[1,1,3,4, 1,2,3] })
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'])