码迷,mamicode.com
首页 > 其他好文 > 详细

Seaborn实现多变量分析

时间:2020-04-24 13:18:00      阅读:69      评论:0      收藏:0      [点我收藏+]

标签:nic   swa   分析   des   pre   pyplot   pandas   cal   rip   

import seaborn as sns
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

sns.set(style = "whitegrid",color_codes = True)
np.random.seed(sum(map(ord,"categorical")))

titanic = pd.read_csv("titanic.csv")
tips = pd.read_csv("tips.csv")
iris = pd.read_csv("iris.csv")

# 显示多个点
# sns.stripplot(x = "day",y = "total_bill",data = tips)
# plt.show()

# sns.swarmplot(x = "day",y = "total_bill",data = tips,hue = "sex")
# # hue="sex" 生成两个颜色的小圆圈 混合进行查看,进行优化
# plt.show()

# # 四分位距 IQR 四分之一到四分之三位 之间的距离
# # N = 1.5 * IQR
# # 离群点  > Q3 + N   ,   < Q1 - N
# sns.boxplot(x = "day",y = "total_bill",data = tips)
# # hue = "time" 列名
# plt.show()

# 小提琴图
# sns.violinplot(x = "total_bill",y = "day",hue = "time",data = tips)
# plt.show()

# # 加入 split 竖着展示
# sns.violinplot(x = "day",y = "total_bill",hue = "sex",data = tips,split = True)
# plt.show()

2020-04-24

Seaborn实现多变量分析

标签:nic   swa   分析   des   pre   pyplot   pandas   cal   rip   

原文地址:https://www.cnblogs.com/hany-postq473111315/p/12766576.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!