jupyter(ipython notebook) 安装和入门教程

时间:2023-12-13 11:29:44
近期大家无论是自己做数据分析还是紧急答辩做PPT,可能都需要画一些数据的展示图;以前大家都是用excel画图,但excel画图存在一定的局限性,比如你要画个累积直方图,excel就很麻烦了,所以给大家介绍一个基于python的交互数据分析工具,ipython notebook。

本文会给大家介绍从零开始安装和使用notebook的入门教程,写的不详细的地方可以多多交流。

本文假设大家都是python “小白”,本教程针对的是Windows平台,python大神可以根据自己的需要看某些章节就好。

安装python2.7

首先从python官网 下载对应的python安装文件,然后按照,安装过程

注意选择全部安装

jupyter(ipython notebook) 安装和入门教程

python测试

打开cmd命令行界面,输入python,回车后可以看到一个简单的交互界面

输入 print "hello world" 会看到hello world的输出

按下Ctrl+Z 然后回车,可以退出

jupyter(ipython notebook) 安装和入门教程

pip测试

在cmd中输入 pip ,看到类似这样的输出证明pip正确安装了

jupyter(ipython notebook) 安装和入门教程

安装VC for Python

没有这个,很多数据分析包都安装不了,因为这些包底层都是C++编写的,可以从这里下载VC for Python

安装常用数据分析用到的python库

pip install numpy
pip install pandas
pip install matplotlib
pip install statsmodels

安装 ipython notebook

pip install jupyter

测试 ipython notebook

命令行输入 ipython notebook,会自动跳转到浏览器,浏览器默认是命令行所在的目录

jupyter(ipython notebook) 安装和入门教程jupyter(ipython notebook) 安装和入门教程

至此,万事俱备,可以开始做自己想做的事情了

简单使用

我们创建一个example文件夹,然后在浏览器(下称jupyter)中进入这个文件夹,然后选择右边的new按钮,下拉选择Python 2

jupyter(ipython notebook) 安装和入门教程jupyter(ipython notebook) 安装和入门教程

然后就可以开始写python的代码了

jupyter(ipython notebook) 安装和入门教程

下面我们开始尝试做数据分析

导入数据分析常用库和配置

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程

jupyter(ipython notebook) 安装和入门教程