Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #loop #dataframe #column #return #unique
ADD COMMENT
Topic
Name
2+9 =