Articles → Pandas → value_counts function in dataframe in pandas

value_counts function in dataframe in pandas






Purpose





Example


import pandas as pd

list = [[1,21,3], [1,5,6], [7, 8,9]]

df = pd.DataFrame(list, columns=['col1','col2','col3'])

df['col1'].value_counts()



Output



Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, May 6, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250