Dsbda La 10
Dsbda La 10
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sepal_length float64
sepal_width float64
petal_length float64
petal_width float64
species object
dtype: object
# Histogram
cols = iris.drop('species', axis=1)
cols.hist(bins=15, figsize=(10, 7))
array([[<Axes: title={'center': 'sepal_length'}>,
<Axes: title={'center': 'sepal_width'}>],
[<Axes: title={'center': 'petal_length'}>,
<Axes: title={'center': 'petal_width'}>]], dtype=object)
# Boxplot.
plt.figure(figsize=(10, 7))
sns.boxplot(cols)
plt.title("Box Plot of Features", fontsize=16)
plt.show()
plt.figure(figsize=(10, 7))
sns.boxplot(x="species", y="petal_length", data=iris)
plt.title("Box Plot: Petal Longth Vs Species", fontsize=16)
plt.show()
plt.figure(figsize=(10, 7))
sns.boxplot(x="species", y="petal_width", data=iris)
plt.title("Box Plot: Petal Width Vs Species", fontsize=16)
plt.show()