Exno 4
Exno 4
DATE:
The Iris Data Set is available from the UC Irvine Machine Learning
Repository at http://archive.ics.uci.edu/ml/datasets/Iris in Comma-Separated
Values (CSV) format. Python’s pandas library is used to import the CSV file. Iris
dataset is a famous dataset that contains five columns: Petal Length, Petal Width,
Sepal Length, Sepal Width, and Species Type.
Iris is a flowering plant; the researchers have measured various features of the
different iris flowers and recorded them digitally.
The pandas read_csv function loads delimited data from a file, URL, or
file-like object using the comma as the default delimiter and creates
a DataFrame object. When a pandas DataFrame object is created, it has many
attributes and methods available that can be used on that object.
AIM:
ALGORITHM:
(i) Descriptive analytics on the Iris dataset by reading data from a specific
location in the computer or from web
Code: Importing pandas to use in code as pd.
import pandas as pd
a. Create csv_url and pass to it the URL where the data set is available
‘https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data'.
csv_url = 'https://archive.ics.uci.edu/ml/machine-learning-
databases/iris/iris.data'
(ii) Descriptive analytics on the Iris dataset by reading data from the
scikit-learn datasets module
Code: Load iris dataset from scikit learn datasets module
from sklearn.datasets import load_iris
iris= load_iris()