Skip to main content

Python Advanced- Visualizing the Titanic Disaster

Another post starts with you beautiful people !
Today we will work on a famous dataset Titanic Dataset taken from kaggle.
This dataset gives information about the details of the passengers aboard the Titanic and a column on survival of the passengers. Those who survived are represented as “1” while those who did not survive are represented as “0”.

The columns in the dataset are as below-
PassengerId: Passenger Identity
Survived: Whether passenger survived or not
Pclass: Class of ticket
Name: Name of passenger
Sex: Sex of passenger (Male or Female)
Age: Age of passenger
SibSp: Number of sibling and/or spouse travelling with passenger
Parch: Number of parent and/or children travelling with passenger
Ticket: Ticket number
Fare: Price of ticket
Cabin: Cabin number

Let's starts some hands on-


Let's generates descriptive statistics-






Result:





Note: if you are seeing error- ImportError: No module named 'seaborn' then it mean you need to install the seaborn library using command- pip install seaborn in the command prompt.


Result:

Let's find out the children in the dataset-


Let's count the person individually-


Now plot Male, Female, Child in Pclass-

Result:





People Who Survived and Who Didn't:




How many Male and Female survived :
                                          
Result-More females survive than males.

Let's compute pairwise correlation of columns, excluding NA/null values:-




Result:

See with the help of above visualization how you can easily transform a dataset into a story telling.
Try in your notebook and share your thoughts in comment.

Comments

Popular posts from this blog

How to use opencv-python with Darknet's YOLOv4?

Another post starts with you beautiful people 😊 Thank you all for messaging me your doubts about Darknet's YOLOv4. I am very happy to see in a very short amount of time my lovely aspiring data scientists have learned a state of the art object detection and recognition technique. If you are new to my blog and to computer vision then please check my following blog posts one by one- Setup Darknet's YOLOv4 Train custom dataset with YOLOv4 Create production-ready API of YOLOv4 model Create a web app for your YOLOv4 model Since now we have learned to use YOLOv4 built on Darknet's framework. In this post, I am going to share with you how can you use your trained YOLOv4 model with another awesome computer vision and machine learning software library-  OpenCV  and of course with Python 🐍. Yes, the Python wrapper of OpenCV library has just released it's latest version with support of YOLOv4 which you can install in your system using below command- pip install opencv-pyt...

How can I make a simple ChatBot?

Another post starts with you beautiful people! It has been a long time of posting a new post. But my friends in this period I was not sitting  where I got a chance to work with chatbot and classification related machine learning problem. So in this post I am going to share all about chatbot- from where I have learned? What I have learned? And how can you build your first bot? Quite interesting right! Chatbot is a program that can conduct an intelligent conversation based on user's input. Since chatbot is a new thing to me also, I first searched- is there any Python library available to start with this? And like always Python has helped me this time also. There is a Python library available with name as  ChatterBot   which is nothing but a machine learning conversational dialog engine. And yes that is all I want to start my learning because I always prefer inbuilt Python library to start my learning journey and once I learn this then only I move ahead for another...

Central Limit Theorem and Hypothesis Testing

Another post starts with you beautiful people! Today we will learn about an important topic related to statistics. Statistical inference is the process of deducing properties of an underlying distribution by analysis of data. Inferential statistical analysis infers properties about a population: this includes testing hypotheses and deriving estimates. Statistics are helpful in analyzing most collections of data. Hypothesis testing can justify conclusions even when no scientific theory exists. You can find more about this here-  tell me more about Statistical_hypothesis_testing Here our case study will be Average Experience of Data Science Specialization(DSS) batch taught in a leading University with Statistical Inference. We will aim to study how accurately can we characterize the actual average participant experience (population mean) from the samples of data (sample mean). We can quantify the certainty of outcome through the confidence intervals. Let's plot the d...