top of page

Exploratory Data Analysis

Working on new datasets and trying to understand different variables in the data is a big challenge, but to understand the variables and the relationship between them exploratory data analysis comes handy. Exploratory data analysis is a best approach to understand the general patterns in the data and to find the data insights.

Below are the steps to follow in Exploratory data analysis :

  1. Understanding the data : Head or tail of dataset, Shape of dataset, data types of column, describe dataset.

  2. Data Cleaning : handling duplicates, missing values, handling null values, dropping unnecessary columns, feature selection.

  3. Analyzing the the variables and the relationship between the variables.

Now in the below example sepsis dataset is used for exploratory data analysis :

  1. Understanding the data :

After importing the libraries and the dataset we have to analyze the data.

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



2. Data Cleaning :

After observing the data we can handle null values or missing values or outliers or deleting unnecessary columns etc.,


We can observe there are unwanted columns and null values in the given dataset, we can handle them in different ways.

Now the unnecessary column is deleted.

Null values of one particular column can be filled or null values of all the data can also be filled.

As we are handling clinical data instead of filling it with string like ‘Not Recorded’ or to fill random data we can fill with 0.

Now we have cleaned the data with no null values.

3. Analyzing the the variables and the relationship between the variables. It can be done in three different ways:

  1. Univariate Analysis : In univariate analysis we can analyze one variable only.

  2. Bivariate Analysis : In Bivariate analysis we can analyze relationship between two variables.

  3. Multivariate Analysis : In Multivariate analysis we can analyze relationship between more than two variables.

Univariate Analysis :

The analysis of no.of patients with and without sepsis is observed.

The percentage of gender in given data is observed.

Length of stay in ICU is analyzed using histogram.

plt.title('Length of Stay in ICU',size=18)

Bivariate Analysis :

#2.Bivariative :

plt.figure(figsize = (10,6))
plt.title('HR vs DBP',size=18)

The correlation between HR and DBP can also be observed as below :

Pair plot of gender and age in data can also be observed.

Multivariate Analysis:

We are analyzing the relation between Age, gender and sepsislabel in below example:

We are analyzing the relation between gender, temperature and sepsislabel in below example:

result = pd.pivot_table(data=df, index='Gender', columns='Temp',values='SepsisLabel')
#create heat map of Gender vs Temp vs SepsisLabel
sns.heatmap(result, annot=True, cmap = 'RdYlGn', center=0.117)

After performing Exploratory Data Analysis(EDA) on the dataset , basic understanding of data , data cleaning and exploring the data using graphs can also be observed.

109 views0 comments

Recent Posts

See All

Exception Handling in Selenium Webdriver

What is an exception? An exception is an error that occurs during the execution of a program. However, while running a program, programming languages generate an exception that must be handled to prev


Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page