Answers for "how to loop through unique value in a pandas data frame"

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 "how to loop through unique value in a pandas data frame"

Python Answers by Framework

Browse Popular Code Answers by Language