Python数据可视化实战——iris数据集可视化
首先,这个Python数据可视化实战是在Iris数据集上完成的。所使用的是Python 3环境下的jupyter notebook。
实战中我们需要用到的库包括:pandas , matplotlib , seaborn.
%matplotlib notebook #在jupyter notebook使用交互式绘图
python
运行
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white", color_codes=True)
iris = pd.read_csv("./input/iris.csv")
iris.head()
python
运行

iris["Species"].value_counts()
python
运行
setosa 50 virginica 50 versicolor 50 Name: Species, dtype: int64
iris.plot(kind="scatter", x="Sepal_Length", y="Sepal_Width")
python
运行

sns.jointplot(x="Sepal_Length", y="Sepal_Width", data=iris, size=5)
python
运行

sns.FacetGrid(iris, hue="Species", size=5)
.map(plt.scatter, "Sepal_Length", "Sepal_Width")
.add_legend()
python
运行

sns.boxplot(x="Species", y="Petal_Length", data=iris)
python
运行

ax = sns.boxplot(x="Species", y="Petal_Length", data=iris)
ax = sns.stripplot(x="Species", y="Petal_Length", data=iris, jitter=True, edgecolor="gray")
python
运行

sns.violinplot(x="Species", y="Petal_Length", data=iris, size=6)
python
运行

sns.FacetGrid(iris, hue="Species", size=6)
.map(sns.kdeplot, "Petal_Length")
.add_legend()
python
运行

sns.pairplot(iris.drop("ID", axis=1), hue="Species", size=3)
python
运行

sns.pairplot(iris.drop("ID", axis=1), hue="Species", size=3, diag_kind="kde")
python
运行

iris.drop("ID", axis=1).boxplot(by="Species", figsize=(12, 6))
python
运行

from pandas.tools.plotting import andrews_curves
andrews_curves(iris.drop("ID", axis=1), "Species")
python
运行

from pandas.tools.plotting import parallel_coordinates
parallel_coordinates(iris.drop("ID", axis=1), "Species")
python
运行

from pandas.tools.plotting import radviz
radviz(iris.drop("ID", axis=1), "Species")
python
运行

参考链接:
https://www.kaggle.com/benhamner/python-data-visualizations
http://seaborn.pydata.org/api.html
http://seaborn.pydata.org/tutorial.html#
http://pandas.pydata.org/pandas-docs/stable/visualization.html
https://matplotlib.org/tutorials/index.html
https://matplotlib.org/gallery/index.html
相关知识
Python数据分析数据可视化
python实战(一)——iris鸢尾花数据集分类
鸢尾花数据可视化直方图
鸢尾花数据seaborn数据可视化
Python编程之美:探索海棠花算法在数据可视化中的应用与实践
使用python对鸢尾花数据进行预处理和可视化
Python实现鸢尾花数据集可视化分析(超详细教程)
鸢尾花数据集降维可视化
【python数据挖掘课程】十九.鸢尾花数据集可视化、线性回归、决策树花样分析
鸢尾花数据集的数据可视化
网址: Python数据可视化实战——iris数据集可视化 https://www.huajiangbk.com/newsview2500248.html
| 上一篇: 《财务大数据可视化智能分析——基 |
下一篇: Seaborn数据可视化案例精讲 |
推荐分享
- 1君子兰什么品种最名贵 十大名 4012
- 2世界上最名贵的10种兰花图片 3364
- 3花圈挽联怎么写? 3286
- 4迷信说家里不能放假花 家里摆 1878
- 5香山红叶什么时候红 1493
- 6花的意思,花的解释,花的拼音 1210
- 7教师节送什么花最合适 1167
- 8勿忘我花图片 1103
- 9橄榄枝的象征意义 1093
- 10洛阳的市花 1039
