题目来源:
https://nbviewer.jupyter.org/github/schmit/cme193-ipython-notebooks-lecture/blob/master/Exercises.ipynb
题目说明:
前置代码内容:
%matplotlib inline
import random
import numpy as np
import scipy as sp
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import math
import statsmodels.api as sm
import statsmodels.formula.api as smf
sns.set_context("talk")
anascombe = pd.read_csv('data/anscombe.csv')
anascombe.head()
初始数据集为:
一:
代码如下:
运行结果:
Mean is as follows:
x y
dataset
I 9.0 7.500909
II 9.0 7.500909
III 9.0 7.500000
IV 9.0 7.500909