1>>> df.duplicated(subset=['brand'])
20 False
31 True
42 False
53 True
64 True
7dtype: bool
8
1>>> df.duplicated(keep='last')
20 True
31 False
42 False
53 False
64 False
7dtype: bool
8
1>>> df = pd.DataFrame({
2... 'brand': ['Yum Yum', 'Yum Yum', 'Indomie', 'Indomie', 'Indomie'],
3... 'style': ['cup', 'cup', 'cup', 'pack', 'pack'],
4... 'rating': [4, 4, 3.5, 15, 5]
5... })
6>>> df
7 brand style rating
80 Yum Yum cup 4.0
91 Yum Yum cup 4.0
102 Indomie cup 3.5
113 Indomie pack 15.0
124 Indomie pack 5.0
13