使用jupyter-notebook进行数据分析
首先需要安装jupyter notebook,打开cmd用 pip install jupyter notebook即可,然后就是下载需要的数据文件。https://pan.baidu.com/s/1Yney0puMONBUceycm4fakg放到代码目录下data文件夹里面。
使用cmd 到需要创建代码的目录下输入jupyter notebook就会跳到jupyter的页面。

点击右上的new创建新文件后就可以输入代码。按shift + Enter 可以运行

Part 1
1、Compute the mean and variance of both x and y

2、Compute the correlation coefficient between x and y

3、Compute the linear regression line:
- y=β0+β1x+ϵy=β0+β1x+ϵ (hint: use statsmodels and look at the Statsmodels notebook)

Part 2
Using Seaborn, visualize all four datasets.
hint: use sns.FacetGrid combined with plt.scatter

本文介绍如何使用Jupyter Notebook进行数据分析与可视化操作。首先通过pip安装Jupyter Notebook,接着下载所需数据文件并置于指定目录。在命令行中启动Jupyter Notebook后,创建新文件并运行代码来计算数据集的均值、方差及相关系数,并利用statsmodels库拟合线性回归模型。此外,还介绍了如何使用Seaborn库绘制四个数据集的图表。
311

被折叠的 条评论
为什么被折叠?



