seaborn画图

import pandas as pd
 
dataset = pd.read_csv("E:\data\cal_housing.csv")
print("Dataset: {}".format(dataset.shape))
print("Columns: {}".format(dataset.columns))
dataset.head(5)

import matplotlib.pyplot as plt
import seaborn as sns

sns.scatterplot(x = 'd', y = 'e', data = dataset)

seaborn画图_第1张图片

# 直方图
plt.figure(figsize = (12, 8))
sns.distplot(a = dataset['h'], bins = 10, hist = True)
plt.title("Density and histogram plot for Median house value")
plt.xlabel("Median house value")
plt.ylabel("Value")

seaborn画图_第2张图片

plt.figure(figsize = (12, 8))
sns.heatmap(dataset.corr(), annot = True)

seaborn画图_第3张图片

sns.jointplot(x = "d", y = "e", data=dataset, kind="reg", height = 8, color = 'g')
plt.xlabel("Total rooms")
plt.ylabel("Total bedrooms")

seaborn画图_第4张图片

sns.pairplot(dataset)

seaborn画图_第5张图片

你可能感兴趣的:(Python,数据)