十四周jupyter homeWork

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用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








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值