Pandas > Drop duplicates

Name
Code
Output
dataframe = pandas.DataFrame(numpy.random.randint(0,10,size=(5, 2)), columns=['C1','C2'])
print ("dataframe")
print (dataframe)
dataframe2 = dataframe.drop_duplicates('C1', keep='first')
print ("dataframe without duplicates")
print (dataframe2)
dataframe
   C1  C2
0   0   6
1   0   9
2   3   3
3   3   0
4   4   6
dataframe without duplicates
   C1  C2
0   0   6
2   3   3
4   4   6