Answers for "for each unique value in column pandas"

4

dataframe unique values in each column

for col in df:
    print(df[col].unique())
Posted by: Guest on August-20-2020
0

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}
Posted by: Guest on August-22-2020

Code answers related to "for each unique value in column pandas"

Python Answers by Framework

Browse Popular Code Answers by Language