I have the following dataframe:
df = pd.DataFrame({
'brand': ['Yum Yum', 'Yum Yum', 'Indomie', 'Indomie', 'Indomie'],
'style': ['cup', 'cup', 'cup', 'pack', 'pack'],
'rating': [4, 4, 3.5, 15, 5]})
df
By using the duplicate function we can get the duplicates.
df.duplicated()
I was wondering if there is a way to mimic the duplicate function without using it instead using data structures such as lists, sets, etc. ?