#PN17
#GN0001
'''
seaborn散点图
'''
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
student=pd.read_csv("c://pytest/keshihua/ucdavis.csv")
g=sns.FacetGrid(student,hue='gender',palette='Set1',size=6)#Seti i [1,2,3]
g.map(plt.scatter,'gpa','computer',s=250,linewidth=0.65,edgecolor='white')
g.add_legend()
plt.show()
'''
数据
gender tv computer sleep height momheight dadheight exercise gpa
Female 13 10 3.5 66 66 71 10 4
Male 20 7 9 72 64 65 2 2.3
Male 15 15 6 68 62 74 3 2.6
Male 8 20 6 68 59 70 6 2.8
Female 2.5 10 5 64 65 70 6.5 2.62
Male 2 14 9 68.5 60 68 2 2.2
Female 4 28 8.5 69 66 76 3 3.78
Female 8 10 7 66 63 70 4.5 3.2
Male 1 15 8 70 68 71 3 3.31
Male 8 25 4.5 67 63 66 6 3.39
Male 3.5 9 8 68 62 64 8 3
Female 11 20 5 68 64 69 0 2.5
Male 10 14 8 68 61 72 10 2.8
Male 1 84 5 61 62 62 3 2.34
Female 10 11 9 65 62 66 5 2
#GN0001
'''
seaborn散点图
'''
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
student=pd.read_csv("c://pytest/keshihua/ucdavis.csv")
g=sns.FacetGrid(student,hue='gender',palette='Set1',size=6)#Seti i [1,2,3]
g.map(plt.scatter,'gpa','computer',s=250,linewidth=0.65,edgecolor='white')
g.add_legend()
plt.show()
'''
数据
gender tv computer sleep height momheight dadheight exercise gpa
Female 13 10 3.5 66 66 71 10 4
Male 20 7 9 72 64 65 2 2.3
Male 15 15 6 68 62 74 3 2.6
Male 8 20 6 68 59 70 6 2.8
Female 2.5 10 5 64 65 70 6.5 2.62
Male 2 14 9 68.5 60 68 2 2.2
Female 4 28 8.5 69 66 76 3 3.78
Female 8 10 7 66 63 70 4.5 3.2
Male 1 15 8 70 68 71 3 3.31
Male 8 25 4.5 67 63 66 6 3.39
Male 3.5 9 8 68 62 64 8 3
Female 11 20 5 68 64 69 0 2.5
Male 10 14 8 68 61 72 10 2.8
Male 1 84 5 61 62 62 3 2.34
Female 10 11 9 65 62 66 5 2