import pandas as pd
#print how many duplicate rows in the dataframe
print(df.duplicated().sum())
df.duplicated(subset='one', keep='first').sum()
import pandas as pd
# Shows count of all the rows with duplicate values
df.duplicated(keep=False).sum()
animals = pd.Series(['lama', 'cow', 'lama', 'beetle', 'lama'])
>>> animals.duplicated()
In [28]:
df.groupby(df.columns.tolist(),as_index=False).size()
Out[28]:
one three two
False False True 1
True False False 2
True True 1
dtype: int64