0% found this document useful (0 votes)
8 views2 pages

Assignment 3 Iris

The document loads and analyzes iris data from a CSV file. It separates the data into the three iris species, and calculates descriptive statistics like mean, standard deviation, minimum and maximum for each species' sepal length, sepal width, petal length, and petal width.

Uploaded by

Akshata Chopade
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)
8 views2 pages

Assignment 3 Iris

The document loads and analyzes iris data from a CSV file. It separates the data into the three iris species, and calculates descriptive statistics like mean, standard deviation, minimum and maximum for each species' sepal length, sepal width, petal length, and petal width.

Uploaded by

Akshata Chopade
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/ 2

In [1]:

import pandas as pd

In [2]:

iris=pd.read_csv("C://Users//Tech Bazaar//Desktop//IRIS.csv")
iris

Out[2]:

sepal_length sepal_width petal_length petal_width species

0 5.1 3.5 1.4 0.2 Iris-setosa

1 4.9 3.0 1.4 0.2 Iris-setosa

2 4.7 3.2 1.3 0.2 Iris-setosa

3 4.6 3.1 1.5 0.2 Iris-setosa

4 5.0 3.6 1.4 0.2 Iris-setosa

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

145 6.7 3.0 5.2 2.3 Iris-virginica

146 6.3 2.5 5.0 1.9 Iris-virginica

147 6.5 3.0 5.2 2.0 Iris-virginica

148 6.2 3.4 5.4 2.3 Iris-virginica

149 5.9 3.0 5.1 1.8 Iris-virginica

150 rows × 5 columns

In [3]:

irisSet=(iris['species']=='Iris-setosa')
print("Iris-setosa")
print(iris[irisSet].describe())

Iris-setosa
sepal_length sepal_width petal_length petal_width
count 50.00000 50.000000 50.000000 50.00000
mean 5.00600 3.418000 1.464000 0.24400
std 0.35249 0.381024 0.173511 0.10721
min 4.30000 2.300000 1.000000 0.10000
25% 4.80000 3.125000 1.400000 0.20000
50% 5.00000 3.400000 1.500000 0.20000
75% 5.20000 3.675000 1.575000 0.30000
max 5.80000 4.400000 1.900000 0.60000
In [4]:

irisVer=(iris['species']=='Iris-versicolor')
print("Iris-versicolor")
print(iris[irisVer].describe())

Iris-versicolor
sepal_length sepal_width petal_length petal_width
count 50.000000 50.000000 50.000000 50.000000
mean 5.936000 2.770000 4.260000 1.326000
std 0.516171 0.313798 0.469911 0.197753
min 4.900000 2.000000 3.000000 1.000000
25% 5.600000 2.525000 4.000000 1.200000
50% 5.900000 2.800000 4.350000 1.300000
75% 6.300000 3.000000 4.600000 1.500000
max 7.000000 3.400000 5.100000 1.800000

In [5]:

irisVir=(iris['species']=='Iris-virginica')
print("Iris-virginica")
print(iris[irisVir].describe())

Iris-virginica
sepal_length sepal_width petal_length petal_width
count 50.00000 50.000000 50.000000 50.00000
mean 6.58800 2.974000 5.552000 2.02600
std 0.63588 0.322497 0.551895 0.27465
min 4.90000 2.200000 4.500000 1.40000
25% 6.22500 2.800000 5.100000 1.80000
50% 6.50000 3.000000 5.550000 2.00000
75% 6.90000 3.175000 5.875000 2.30000
max 7.90000 3.800000 6.900000 2.50000

You might also like