Files
Python-for-Geeks/Chapter13/iris_eval_svc_model/iris_data_analysis.py
T
2021-08-11 17:30:39 +04:00

25 lines
592 B
Python

#iris_data_analysis.py
from pandas import read_csv
from matplotlib import pyplot
from pandas.plotting import scatter_matrix
data_file = "iris/iris.data"
iris_names = ['sepal-length', 'sepal-width', 'petal-length', 'petal-width', 'class']
df = read_csv(data_file, names=iris_names)
print(df.shape)
print(df.head(20))
print(df.describe())
print(df.groupby('class').size())
# box and whisker plots
df.plot(kind='box', subplots=True, layout=(2,2), sharex=False, sharey=False)
pyplot.show()
# check the histograms
df.hist()
pyplot.show()
# scatter plot matrix
scatter_matrix(df)
pyplot.show()