Mastery of exploratory data analysis (EDA) for data science enthusiasts

Contents

Overview

  • Step-by-step approach to performing EDA
  • Resources like blogs, MOOCS to become familiar with EDA
  • Become familiar with various data visualization techniques, charts and diagrams.
  • Demonstration of some steps with the Python code snippet

What differentiates one data science professional from another??

It's not machine learning, It is not deep learning, it's not sql, is exploratory data analysis (EDA). How good is one with pattern identification? / hidden trends in the data and how valuable the insights are, is what sets data professionals apart.

1. What is exploratory data analysis?

Exploratory data analysis is an approach to analyze data sets to summarize their main features, often using statistical graphs and other data visualization methods.
EDA helps data science professionals in several ways: –

1 Get a better understanding of the data
2 Identify various data patterns
3 Better understand the problem statement

[ Note: the dataset in this blog is being opted as iris dataset]

2. Checking the introductory details about the data

The first and most important step of any data analysis, after uploading the data file, should consist of checking some introductory details. What, no. of columns, no. of rows, feature types (categorical or numerical), column entry data types.

Python code snippet

data.info ()


RangeIndex: 150 tickets, 0 a 149
data columns (5 columns in total):
# Non-Null Count Type Column
– —— ————– —–
0 sepal_length 150 not null float64
1 sepal_width 150 float64 not null
2 petal_length 150 not null float64
3 petal_width 150 not null float64
4 species 150 non null object
dtypes: float64 (4), object (1)
memory usage: 6.0+ KB

data.head () To display the first five rows

30861new20blog-8287175

data.tail () to display the last five rows

40174blog2-6133290

3. statistical perspective

This step should be done to get details on various statistical data such as mean, standard deviation, median, maximum value, minimum value.

Python code snippet

data.describe ()

27711capture1-1679038

4. Data cleansing

This is the most important step in EDA that involves removing rows / duplicate columns, fill empty entries with values ​​as the mean / data median, remove multiple values, remove null entries

Null input check

Python code snippet

data.IsNull (). sum da el número de valores perdidos para cada variable

47799blog4-3722464

Remove null entries

Python code snippet

data.dropna (axis = 0, inplace = True) If there are null entries

Fill values ​​instead of null inputs (if it is a numeric function)

Values ​​can be mean, the median or any integer

Python code snippet

data[“sepal_length”].fillna (value = data[“sepal_length”].mean (), inplace = True) if there is a null input

Duplicate Check

Python code snippet

data.duplicated (). sum () returns the total number of duplicate entries

Remove duplicates

Python code snippet

data.drop_duplicates (inplace = True)

5. Data visualization

Data visualization is the method of converting raw data into a visual form., like a map or graph, to make the data easier to understand and extract useful information..

The main goal of data visualization is to put large data sets into a visual representation.. It is one of the important and easy steps when it comes to data science.

You can refer to the blog below for more details on data visualization.

Various types of visualization analysis are:

a. Univariate analysis:

This shows each observation / distribution of data on a single data variable.. Se puede mostrar con la ayuda de varios diagramas como Dispersion diagram, line diagram, histogram plot (abstract), box plots, fiddle diagram, etc.

B. Bivariate analysis:

Bivariate analysis screens are performed to reveal the relationship between two data variables. It can also be shown with the help of scatter plots, histogramas, heat maps, box plots, violin diagrams, etc.

C. Analisis multivariable:

Multivariate analysis, as the name suggests, are displayed to reveal the relationship between more than two data variables.

Scatter diagrams, histogramas, box plots, fiddle plots can be used for multivariate analysis

several plots

Below are some of the charts that can be implemented for univariate analysis, bivariate and multivariate

a. Scatter plot

Python code snippet

plt.figure (figsize = (17,9))
plt.title (‘Comparison between various species according to the length and width of the sapel’)
sns.scatterplot (data[‘sepal_length’],data[‘sepal_width’], tone = data[‘species’], s = 50)

39544b2-5963817

For multivariate analysis

Python code snippet

sns.pairplot (data, hue = ”species”, height = 4)

71974bl4-3866710

B. Box plot

Box plot to see how the categorical characteristic is distributed “Species” with the other four input variables

Python code snippet

fig, axes = plt.subplots (2, 2, figsize = (16,9))
sns.boxplot (y = “petal_width”, x = “species”, data = iris_data, orient = ‘v’, ax = axes[0, 0])
sns.boxplot (y = “petal_length”, x = “species”, data = iris_data, orient = ‘v’, ax = axes[0, 1])
sns.boxplot (y = ”sepal_length”, x = “species”, data = iris_data, orient = ‘v’, ax = axes[1, 0])
sns.boxplot (y = “sepal_width”, x = “species”, data = iris_data, orient = ‘v’, ax = ejes[1, 1])
plt.show ()

61799download203-8139265

C. Violin frame

More informative than the box plot and shows the full distribution of the data.

Python code snippet

fig, axes = plt.subplots (2, 2, figsize = (16,10))
sns.violinplot (y = ”petal_width”, x = “species”, data = iris_data, orient = ‘v’, ax = axes[0, 0], inner = 'quartile')
sns.violinplot (y = “petal_length”, x = “species”, data = iris_data, orient = ‘v’, ax = ejes[0, 1], inner = 'quartile')
sns.violinplot (y = ”sepal_length”, x = “species”, data = iris_data, orient = ‘v’, ax = axes[1, 0], inner = 'quartile')
sns.violinplot (y = ”sepal_width”, x = “species”, data = iris_data, orient = ‘v’, ax = axes[1, 1], inner = 'quartile')
plt.show ()

74915download205-2021386

D. Histogramas

It can be used to visualize the probability density function (PDF)

Python code snippet

sns.FacetGrid (iris_data, hue = ”species”, height = 5)
.map (sns.distplot, “petal_width”)
.add_legend ();

21544download207-8163074

With this I end this blog.
Hi everyone, Namaste
My name is Pranshu Sharma and i'm a data science enthusiast
Thank you very much for taking your valuable time to read this blog.. Feel free to point out any errors (after all, i am an apprentice) and provide the corresponding comments or leave a comment.
Dhanyvaad !!
Feedback:
Email: [email protected]

You can refer to the blog mentioned below to get familiar with exploratory data analysis.

The media shown in this article is not the property of DataPeaker and is used at the author's discretion.

Subscribe to our Newsletter

We will not send you SPAM mail. We hate it as much as you.

Datapeaker