0

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

1

1 Answer 1

1

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);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.