0% found this document useful (0 votes)
13 views5 pages

A2 60 Rohit Jakkam EDA of Iris - Ipynb - Colaboratory

This document performs exploratory data analysis on the Iris dataset using Python libraries like Pandas and Seaborn. It loads and inspects the Iris data, calculates some statistics, and produces various visualizations of relationships between variables in the data.

Uploaded by

kingsourabh1074
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views5 pages

A2 60 Rohit Jakkam EDA of Iris - Ipynb - Colaboratory

This document performs exploratory data analysis on the Iris dataset using Python libraries like Pandas and Seaborn. It loads and inspects the Iris data, calculates some statistics, and produces various visualizations of relationships between variables in the data.

Uploaded by

kingsourabh1074
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

8/17/23, 1:07 PM A2_60_Rohit_Jakkam_EDA of Iris.

ipynb - Colaboratory

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.datasets import load_iris

Dataset = load_iris()

df= pd.DataFrame(Dataset.data,columns=Dataset.feature_names)

df.head()

sepal length (cm) sepal width (cm) petal length (cm) petal width (cm)

0 5.1 3.5 1.4 0.2

1 4.9 3.0 1.4 0.2

2 4.7 3.2 1.3 0.2

3 4.6 3.1 1.5 0.2

4 5.0 3.6 1.4 0.2

df.info()

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 150 entries, 0 to 149
Data columns (total 4 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 sepal length (cm) 150 non-null float64
1 sepal width (cm) 150 non-null float64
2 petal length (cm) 150 non-null float64
3 petal width (cm) 150 non-null float64
dtypes: float64(4)
memory usage: 4.8 KB

df.corr()

sepal length sepal width petal length petal width


(cm) (cm) (cm) (cm)

sepal length
1.000000 -0.117570 0.871754 0.817941
(cm)

sepal width
-0.117570 1.000000 -0.428440 -0.366126
(cm)

petal length
0 871754 0 428440 1 000000 0 962865
df.isnull()

sepal length (cm) sepal width (cm) petal length (cm) petal width (cm)

0 False False False False

1 False False False False

2 False False False False

3 False False False False

4 False False False False

... ... ... ... ...

145 False False False False

146 False False False False

147 False False False False

148 False False False False

149 False False False False

150 rows × 4 columns

df.describe()

https://colab.research.google.com/drive/1UKDMtRN84jp7HFFcfANIT_6WS1d3f4xN#scrollTo=onyvFnsZWKea&printMode=true 1/5
8/17/23, 1:07 PM A2_60_Rohit_Jakkam_EDA of Iris.ipynb - Colaboratory

sepal length (cm) sepal width (cm) petal length (cm) petal width (cm)

count 150.000000 150.000000 150.000000 150.000000

mean 5.843333 3.057333 3.758000 1.199333

std 0.828066 0.435866 1.765298 0.762238

min 4.300000 2.000000 1.000000 0.100000

25% 5.100000 2.800000 1.600000 0.300000

50% 5.800000 3.000000 4.350000 1.300000

75% 6.400000 3.300000 5.100000 1.800000


df.shape
max 7.900000 4.400000 6.900000 2.500000

(150, 4)

df.size

600

sns.pairplot(df)

<seaborn.axisgrid.PairGrid at 0x7c556469f2e0>

sns.heatmap(df,cbar=True,cmap='viridis')

https://colab.research.google.com/drive/1UKDMtRN84jp7HFFcfANIT_6WS1d3f4xN#scrollTo=onyvFnsZWKea&printMode=true 2/5
8/17/23, 1:07 PM A2_60_Rohit_Jakkam_EDA of Iris.ipynb - Colaboratory

<Axes: >

sns.heatmap(df.isnull())

<Axes: >

sns.set_style('whitegrid')
sns.countplot(x='sepal length (cm)',data =df)

https://colab.research.google.com/drive/1UKDMtRN84jp7HFFcfANIT_6WS1d3f4xN#scrollTo=onyvFnsZWKea&printMode=true 3/5
8/17/23, 1:07 PM A2_60_Rohit_Jakkam_EDA of Iris.ipynb - Colaboratory

<Axes: xlabel='sepal length (cm)', ylabel='count'>

sns.countplot(x='sepal width (cm)',data =df)

<Axes: xlabel='sepal width (cm)', ylabel='count'>

df['sepal length (cm)'].unique()

array([5.1, 4.9, 4.7, 4.6, 5. , 5.4, 4.4, 4.8, 4.3, 5.8, 5.7, 5.2, 5.5,
4.5, 5.3, 7. , 6.4, 6.9, 6.5, 6.3, 6.6, 5.9, 6. , 6.1, 5.6, 6.7,
6.2, 6.8, 7.1, 7.6, 7.3, 7.2, 7.7, 7.4, 7.9])

df['sepal width (cm)'].unique()

array([3.5, 3. , 3.2, 3.1, 3.6, 3.9, 3.4, 2.9, 3.7, 4. , 4.4, 3.8, 3.3,
4.1, 4.2, 2.3, 2.8, 2.4, 2.7, 2. , 2.2, 2.5, 2.6])

df[['petal length (cm)']].boxplot()

<Axes: >

sns.boxplot (x="petal width (cm)",y ="petal length (cm)",data=df,palette='winter')


# plt.savefig("boxplot1.png")

https://colab.research.google.com/drive/1UKDMtRN84jp7HFFcfANIT_6WS1d3f4xN#scrollTo=onyvFnsZWKea&printMode=true 4/5
8/17/23, 1:07 PM A2_60_Rohit_Jakkam_EDA of Iris.ipynb - Colaboratory

<Axes: xlabel='petal width (cm)', ylabel='petal length (cm)'>

Colab paid products - Cancel contracts here

check 0s completed at 12:48 PM

https://colab.research.google.com/drive/1UKDMtRN84jp7HFFcfANIT_6WS1d3f4xN#scrollTo=onyvFnsZWKea&printMode=true 5/5

You might also like