Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

seaborn countplot

## for single column
sns.countplot(y=df.col)

## for multiple columns
fig, ax = plt.subplots(1, 3, figsize=(25, 10))
fig.suptitle('Count Plot', fontsize=16, y=0.92)

columns = ['Income', 'Age', 'Purchased']
for i, col in enumerate(columns):
    graph = sns.countplot(y=df[col], ax=ax[i])
    ax[i].set_title(*[col])
    graph.bar_label(graph.containers[0])
Comment

PREVIOUS NEXT
Code Example
Python :: permutations of a set 
Python :: exec: "python": executable file not found in $PATH Error compiling for board ESP32 Dev Module. 
Python :: python delete text in text file 
Python :: python depth first search 
Python :: how can item in list change in int in python 
Python :: python file count 
Python :: curl in python 
Python :: python zeros to nan 
Python :: loop through python object 
Python :: pandas change to numeric 
Python :: python pandas apply function to one column 
Python :: np argmin top n 
Python :: python requests response get text 
Python :: python glob 
Python :: Create list with numbers between 2 values by 
Python :: setting p a virtual envioronment 
Python :: tkinter prevent window resize 
Python :: f string in python 
Python :: django hash password 
Python :: find substr within a str in python 
Python :: how to connect wifi using python 
Python :: remove punctuation python string library 
Python :: urllib3 python 
Python :: python how to keep turtle window open 
Python :: dataframe create 
Python :: flask autherror 
Python :: how to run linux command in python 
Python :: python - count how many unique in a column 
Python :: python get memory address 
Python :: change the frequency to column in pandas 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =