Rajesh V
Rajesh V

Reputation: 11

countplot in seaborn of python

I have CSV data from titanic machine learning for disaster website:

https://www.kaggle.com/c/titanic/data

CSV files named train and test are available.

train.csv has the column 'Survived'. I need to do a countplot for this column and give 'hue' arguments as below:

sns.countplot(x='Survived', data=train, hue='Sex', hue='Pclass')

Here I could add only one option for hue. Is there any possibility to add more options to hue argument. If so, How can I add

Upvotes: 0

Views: 651

Answers (1)

Kubra Kkartal
Kubra Kkartal

Reputation: 17

You can use seaborn.catplot. You can try this code,

sns.catplot(x="Survived", hue="Sex", col="Pclass",
                data=train, kind="count",
                height=4, aspect=.9);

Upvotes: 1

Related Questions