for loop unique values in dataframe coloumns python code example
Example 1: dataframe unique values in each column
for col in df:
print(df[col].unique())
Example 2: loop through dataframe column and return unique value
which_columns = ... # specify the columns whose unique values you want here
uniques = {col: df[col].unique() for col in which_columns}