1#TO count repetition of each unique values(to find How many times the same-
2# unique value is appearing in the data)
3
4item_counts = df["Your_Column"].value_counts()
5#Returns Dictionary => {"Value_name" : number_of_appearences}
11
2# get the unique values (rows) by retaining last row
32
4df.drop_duplicates(keep='last')
5
1df = pd.DataFrame(np.random.randint(0,2,size = (10,3)))
2df
3 0 1 2
40 1 1 1
51 1 0 1
62 1 1 1
73 1 0 0
84 1 1 1
95 1 0 1
106 0 0 1
117 0 1 1
128 0 1 0
139 0 0 1
14# the only unique rows are : 3, 7 and 8
15df.duplicated(keep = False) == False
160 False
171 False
182 False
193 True
204 False
215 False
226 False
237 True
248 True
259 False
26dtype: bool
27# so to count how many unique rows we have:
28sum(df.duplicated(keep = False) = False)
293