#TO count repetition of each unique values(to find How many times the same-# unique value is appearing in the data)
item_counts = df["Your_Column"].value_counts()#Returns Dictionary => {"Value_name" : number_of_appearences}
# import pandas libraryimport pandas as pd
# create pandas DataFrame
df = pd.DataFrame({'fruits':['orange','mango','apple','grapes','orange','mango'],'price':['40','80','30','40','30','80'],'quantity':['200','300','300','400','200','800']})# get the unique value of column fruitsprint(df.fruits.unique())
Find unique values in all columns in Pandas DataFrame
# import pandas libraryimport pandas as pd
# create pandas DataFrame
df = pd.DataFrame({'fruits':['orange','mango','apple','grapes','orange','mango'],'price':['40','80','30','40','30','80'],'quantity':['200','300','300','400','200','800']})# get the unique value of all columnsfor col in df:print(df
.unique())