Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

value_counts to list

df[column].value_counts()

# get indexes
df[column].value_counts().index.tolist()

# get values of occurrences
df[column].value_counts().values.tolist()
Comment

PREVIOUS NEXT
Code Example
Python :: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable. 
Python :: get the last element of a list python 
Python :: how to use enumerate instead of range and len 
Python :: How to create a hyperlink with a Label in Tkinter 
Python :: how to check prefix in python 
Python :: space to underscore python 
Python :: how to change a string to small letter in python 
Python :: how to find mean of one column based on another column in python 
Python :: ignition create dataset 
Python :: how to get height in pyqt5 
Python :: change the color of the button on hovering tkinter 
Python :: python dataframe get numeric columns 
Python :: how to get what type of file in python 
Python :: how to make a button circular in python 
Python :: run 2 loops simultaneously python 
Python :: how to iterate pandas dataframe 
Python :: python get dates between two dates 
Python :: text to pandas 
Python :: PIL Make Circle 
Python :: find absolut vale in python 
Python :: python emoji 
Python :: virtual environment flask 
Python :: python maths max value capped at x 
Python :: python multiply one column of array by a value 
Python :: getting pi in python 
Python :: remove all zeros from list python 
Python :: pyspark groupby sum 
Python :: The following code shows how to reset the index of the DataFrame and drop the old index completely: 
Python :: python drop axis 
Python :: python check if type 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =