Exploratory Data Analysis On Iris Dataset

Hi Everyone, We are Back with a New Project. In this Project, We Use Iris Dataset for Exploratory Data Analysis.
Necessary Library for this project,
- Pandas
- Numpy
- Seaborn
- Matplotlib
These Libraries are Enough for EDA. Now Let's Start
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
#Load Datasets
iris = pd.read_csv('iris.csv')
#check Shape of this project
print(iris.shape)
#Check Columns in this project
print(iris.columns)
#Check Species of Iris Datasets
print("iris['species'].value_counts()")
#Check Scatter Plot Between Sepal_length Vs Sepal_width
iris.plot(kind='scatter', x='sepal_length', y='sepal_width')
plt.show()
Create a Whitegrid Scatter Plot Between sepal_leangth Vs Sepal_width , Hue= species
sns.set_style('whitegrid')
sns.FacetGrid(iris, hue='species',size=4) \
.map(plt.scatter, 'sepal_length', 'sepal_width') \
.add_legend()
plt.show()
Now We Show a Pairplot
plt.close()
sns.set_style('whitegrid')
sns.pairplot(iris,hue='species',size=3)
plt.show()
![]()
sns.FacetGrid(iris, hue='species', size=5) \ .map(sns.distplot, 'sepal_width') \ .add_legend() plt.show() Output:- ![]()
PDF and CDF
counts, bin_edges = np.histogram(iris_setosa['petal_length'], bins=10, density=True)
pdf = counts/(sum(counts))
print(pdf)
print(bin_edges)
cdf = np.cumsum(pdf)
plt.plot(bin_edges[1:],pdf)
plt.plot(bin_edges[1:], cdf)
counts, bin_edges = np.histogram(iris_setosa['petal_length'], bins=20, density=True)
pdf = counts/(sum(counts))
plt.plot(bin_edges[1:], pdf)
plt.show()
Box Plot
sns.boxplot(x='species',y='petal_length',data=iris)
plt.showow()
sns.violinplot(x='species',y='petal_length',data=iris,size=8)
plt.show()
Jointplot
sns.jointplot(x='petal_length',y='petal_width',data=iris_setosa,kind='kde')
plt.show()
Download Source Code
Thanks for Reading Share this Post
Random Blogs
- The Ultimate Guide to Data Science: Everything You Need to Know
- Deep Learning (DL): The Core of Modern AI
- Big Data: The Future of Data-Driven Decision Making
- The Ultimate Guide to Machine Learning (ML) for Beginners
- Window Functions in SQL – The Ultimate Guide
- Generative AI - The Future of Artificial Intelligence
- Understanding HTAP Databases: Bridging Transactions and Analytics
- 15 Amazing Keyword Research Tools You Should Explore
- Career Guide: Natural Language Processing (NLP)
- What to Do When Your MySQL Table Grows Too Wide
Prepare for Interview
- JavaScript Interview Questions for 0–1 Year Experience
- JavaScript Interview Questions For Fresher
- SQL Interview Questions for 5+ Years Experience
- SQL Interview Questions for 2–5 Years Experience
- SQL Interview Questions for 1–2 Years Experience
- SQL Interview Questions for 0–1 Year Experience
- SQL Interview Questions for Freshers
- Design Patterns in Python
- Dynamic Programming and Recursion in Python
- Trees and Graphs in Python
- Linked Lists, Stacks, and Queues in Python
Datasets for Machine Learning
- Amazon Product Reviews Dataset
- Ozone Level Detection Dataset
- Bank Transaction Fraud Detection
- YouTube Trending Video Dataset (updated daily)
- Covid-19 Case Surveillance Public Use Dataset
- US Election 2020
- Forest Fires Dataset
- Mobile Robots Dataset
- Safety Helmet Detection
- All Space Missions from 1957
- OSIC Pulmonary Fibrosis Progression Dataset
- Wine Quality Dataset
- Google Audio Dataset
- Iris flower dataset
- Artificial Characters Dataset
- Bitcoin Heist Ransomware Address Dataset