scatter
import pandas as pd df_train=pd.read_excel(r"C:UsersLiugengxinDesktop回归.xlsx") Y = '森林火灾次数' X = '人口' data = pd.concat([df_train[X], df_train[Y]], axis=1) data.plot.scatter(x=X, y=Y, ylim=(0,1.2))
boxplot
matlab
a=xlsread('C:UsersLiugengxinDesktop est.xlsx','sheet1'); %x is lable(country,credit) y is value x=a(:,2) y=a(:,1) boxplot(y,x)
python
import seaborn as sns import matplotlib.pyplot as plt import pandas as pd df_train=pd.read_excel(r"C:UsersLiugengxinDesktop课程数据科学大作业原始数据 rain.xlsx") var = 'OverallQual' data = pd.concat([df_train['SalePrice'], df_train[var]], axis=1) f,ax = plt.subplots(figsize=(8,6 )) fig = sns.boxplot(x=var, y="SalePrice", data=data) fig.axis(ymin=0, ymax=800000);