Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
guipsamora
GitHub Repository: guipsamora/pandas_exercises
Path: blob/master/07_Visualization/Titanic_Desaster/Solutions.ipynb
547 views
Kernel: Python 2

Visualizing the Titanic Disaster

Introduction:

This exercise is based on the titanic Disaster dataset avaiable at Kaggle. To know more about the variables check here

Step 1. Import the necessary libraries

import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np %matplotlib inline

Step 2. Import the dataset from this address

Step 3. Assign it to a variable titanic

Step 4. Set PassengerId as the index

Step 5. Create a pie chart presenting the male/female proportion

Image in a Jupyter notebook

Step 6. Create a scatterplot with the Fare payed and the Age, differ the plot color by gender

(-5, 85)
Image in a Jupyter notebook

Step 7. How many people survived?

342

Step 8. Create a histogram with the Fare payed

Image in a Jupyter notebook

BONUS: Create your own question and answer it.