0% found this document useful (0 votes)
16 views

Assign10.Ipynb - Colab

The document loads and analyzes a dataset containing measurements of iris flowers. It describes the dataset, generates statistical summaries, and produces visualizations of the different features.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Assign10.Ipynb - Colab

The document loads and analyzes a dataset containing measurements of iris flowers. It describes the dataset, generates statistical summaries, and produces visualizations of the different features.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

4/17/24, 11:37 AM Assign10.

ipynb - Colab

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

data = pd.read_csv('https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/r
data

output sepal_length sepal_width petal_length petal_width species

0 5.1 3.5 1.4 0.2 setosa

1 4.9 3.0 1.4 0.2 setosa

2 4.7 3.2 1.3 0.2 setosa

3 4.6 3.1 1.5 0.2 setosa

4 5.0 3.6 1.4 0.2 setosa

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

145 6.7 3.0 5.2 2.3 virginica

146 6.3 2.5 5.0 1.9 virginica

147 6.5 3.0 5.2 2.0 virginica

148 6.2 3.4 5.4 2.3 virginica

149 5.9 3.0 5.1 1.8 virginica

150 rows × 5 columns

Next steps: Generate code with data


toggle_off View recommended plots

data.head()

sepal_length sepal_width petal_length petal_width species

0 5.1 3.5 1.4 0.2 setosa

1 4.9 3.0 1.4 0.2 setosa

2 4.7 3.2 1.3 0.2 setosa

3 4.6 3.1 1.5 0.2 setosa

4 5.0 3.6 1.4 0.2 setosa

Next steps: Generate code with data


toggle_off View recommended plots

data.describe()

https://colab.research.google.com/drive/12Evg-z6oqrdTz2gKGaLI976bOXWxvG19#scrollTo=HjMPco5PqllR&printMode=true 1/8
4/17/24, 11:37 AM Assign10.ipynb - Colab

sepal_length sepal_width petal_length petal_width

count 150.000000 150.000000 150.000000 150.000000

mean 5.843333 3.054000 3.758667 1.198667

std 0.828066 0.433594 1.764420 0.763161

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

max 7.900000 4.400000 6.900000 2.500000

data.describe(include = 'object')

species

count 150

unique 3

top setosa

freq 50

data.isnull().sum()

sepal_length 0
sepal_width 0
petal_length 0
petal_width 0
species 0
dtype: int64

print("\n\nThe features in the dataset are as follows : ")


print("1. Sepal length : ", data['sepal_length'].dtype)
print("2. Sepal width : ", data['sepal_width'].dtype)
print("3. Petal length : ", data['petal_length'].dtype)
print("4. Petal width : ", data['petal_width'].dtype)
print("5. Species : ", data['species'].dtype)

The features in the dataset are as follows :


1. Sepal length : float64
2. Sepal width : float64
3. Petal length : float64
4. Petal width : float64
5. Species : object

https://colab.research.google.com/drive/12Evg-z6oqrdTz2gKGaLI976bOXWxvG19#scrollTo=HjMPco5PqllR&printMode=true 2/8
4/17/24, 11:37 AM Assign10.ipynb - Colab

sns.histplot(x = data['sepal_length'], kde=True)

<Axes: xlabel='sepal_length', ylabel='Count'>

sns.histplot(x = data['sepal_width'], kde=True)

<Axes: xlabel='sepal_width', ylabel='Count'>

https://colab.research.google.com/drive/12Evg-z6oqrdTz2gKGaLI976bOXWxvG19#scrollTo=HjMPco5PqllR&printMode=true 3/8
4/17/24, 11:37 AM Assign10.ipynb - Colab

sns.histplot(x = data['petal_length'], kde=True)

<Axes: xlabel='petal_length', ylabel='Count'>

sns.histplot(x = data['petal_width'], kde=True)

<Axes: xlabel='petal_width', ylabel='Count'>

https://colab.research.google.com/drive/12Evg-z6oqrdTz2gKGaLI976bOXWxvG19#scrollTo=HjMPco5PqllR&printMode=true 4/8
4/17/24, 11:37 AM Assign10.ipynb - Colab

sns.boxplot(data['sepal_length'])

<Axes: ylabel='sepal_length'>

sns.boxplot(data['sepal_width'])

<Axes: ylabel='sepal_width'>

sns.boxplot(data['petal_length'])

https://colab.research.google.com/drive/12Evg-z6oqrdTz2gKGaLI976bOXWxvG19#scrollTo=HjMPco5PqllR&printMode=true 5/8
4/17/24, 11:37 AM Assign10.ipynb - Colab

<Axes: ylabel='petal_length'>

sns.boxplot(data['petal_width'])

<Axes: ylabel='petal_width'>

sns.boxplot(x='sepal_length',y='species',data=data)

https://colab.research.google.com/drive/12Evg-z6oqrdTz2gKGaLI976bOXWxvG19#scrollTo=HjMPco5PqllR&printMode=true 6/8
4/17/24, 11:37 AM Assign10.ipynb - Colab

<Axes: xlabel='sepal_length', ylabel='species'>

sns.boxplot(x='petal_length',y='species',data=data)

<Axes: xlabel='petal_length', ylabel='species'>

Start coding or generate with AI.

https://colab.research.google.com/drive/12Evg-z6oqrdTz2gKGaLI976bOXWxvG19#scrollTo=HjMPco5PqllR&printMode=true 7/8
4/17/24, 11:37 AM Assign10.ipynb - Colab

https://colab.research.google.com/drive/12Evg-z6oqrdTz2gKGaLI976bOXWxvG19#scrollTo=HjMPco5PqllR&printMode=true 8/8

You might also like