Search
 
SCRIPT & CODE EXAMPLE
 

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}
Comment

PREVIOUS NEXT
Code Example
Python :: python variables in multiline string 
Python :: find index of values greater than python 
Python :: what is seaborn in python 
Python :: 3d array python numpy 
Python :: python save dictionary 
Python :: how to make a variable 
Python :: python count array length 
Python :: np where nan 
Python :: python get the last element from the list 
Python :: python merge pdf files into one 
Python :: copy file python 
Python :: pandas column filter 
Python :: extract integer from a string in pandas 
Python :: importing database in dataframe using sqlalchemy 
Python :: django check user admin 
Python :: Kill python background process 
Python :: python multiline comment 
Python :: buscar valor aleatorio de una lista python 
Python :: args kwargs python 
Python :: iterate backwards through a list python 
Python :: pandas groupby mean round 
Python :: requests 
Python :: How To Display A Background Image With Tkinter 
Python :: remove all rows with at least one zero pandas 
Python :: python is folder or file 
Python :: python super 
Python :: run matlab code in python 
Python :: python how to add up all numbers in a list 
Python :: python read file into variable 
Python :: how to check if an element is in a list python 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =