Reputation: 91
I want to make bar graph btw the Employment Status and the counts of the status . i want to plot from seaborn library and palette = "viridis" .
df_loan_2['EmploymentStatus'].value_counts()
Employed 67310
Full-time 7927
Self-employed 4538
Other 3806
Not employed 649
Retired 367
Part-time 256
Name: sum, dtype: int64
df_loan_2['EmploymentStatus'].value_counts().plot(kind='barh',color='red')
plt.title('EmploymentStatus')
plt.xlabel('count')
plt.ylabel('status')
plt.fontsize = 12
plt.figsize=(12,12)
Upvotes: 1
Views: 54
Reputation: 1715
You can do it like so with barplot:
import seaborn as sns
sns.barplot(x=df_loan_2['EmploymentStatus'].value_counts().index, y=df_loan_2['EmploymentStatus'].value_counts())
Or you can do it with a countplot in seaborn in an easier way:
sns.countplot(x='EmploymentStatus', data=df_loan_2)
Upvotes: 1