Exploratory Data Analysis on Iris Dataset
dataset link :- https://archive.ics.uci.edu/ml/datasets/Iris
Import all libraries
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
df = pd.read_csv("https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/iris.csv")
df.head()
df.shape
df.loc[df['species']=='setosa']
df_setosa=df.loc[df['species']=='setosa']
df_virginica=df.loc[df['species']=='virginica']
df_versicolor=df.loc[df['species']=='versicolor']
plt.plot(df_setosa['sepal_length'],np.zeros_like(df_setosa['sepal_length']),'o')
plt.plot(df_virginica['sepal_length'],np.zeros_like(df_virginica['sepal_length']),'o')
plt.plot(df_versicolor['sepal_length'],np.zeros_like(df_versicolor['sepal_length']),'o')
plt.xlabel("sepal_length")
plt.show()
sns.FacetGrid(df,hue='species',size=5).map(plt.scatter,"petal_length","sepal_width").add_legend();
plt.show()
sns.pairplot(df,hue='species',size=3)