1.1Jupyter notbook 的使用

目录

  1. 安装Jupyter notebook

  2. 启动Jupyter notebook

  3. 文件管理

  4. 基本的操作与概念

  5. 常用快捷键

(一)安装Jupyter notebook

1.在控制台输入:

pip install jupyter

2.注意:

很多网上的教程推荐安装Anoconda,本文章讲的是已经安装了python解释器,在不安装>Anoconda的情况下,自已独立的安装ipython和jupyter.
本人自认为,Anoconda是比较好,不过还是喜欢轻量级的包,和自己管理包,自己才清楚用哪些包。

3.安装的过程:

(1)安装前的库

1.1Jupyter notbook 的使用

(2)安装jupyter

1.1Jupyter notbook 的使用

(3)安装后的包

1.1Jupyter notbook 的使用

(4)注:安装的依赖库

安装jupyter后,会自动安装其他依赖库,其依赖库多达20多个,其中包括ipython,不过相对于Anoconda的七八百个库,自己安装jupyter的体积还是比较小的。

(二)启动Jupyter notebook

1.在命令行输入:

jupyter notebook

1.1Jupyter notbook 的使用

2.打开的首页:

会自动打开浏览器(在网页端编写代码)

1.1Jupyter notbook 的使用

(三)文件管理

1.选择文件的保存路径

1.1Jupyter notbook 的使用

1.1Jupyter notbook 的使用

2.增加文件夹

1.1Jupyter notbook 的使用

3.删除与修改文件

1.1Jupyter notbook 的使用

4.创建python笔记

1.1Jupyter notbook 的使用

5.修改笔记的标题

1.1Jupyter notbook 的使用

(四)基本概念与操作

1.什么是Cell?

1.1Jupyter notbook 的使用

2.命令状态与编辑状态

(1)当Cell的边框为绿色时,是编辑状态

1.1Jupyter notbook 的使用

(2)当Cell的边框为蓝色时,是命令状态

1.1Jupyter notbook 的使用

3.代码与笔记模式

(1)Code模式,在Cell前有[in] 标记

1.1Jupyter notbook 的使用

(2)Markdown模式,在Cell前无[in] 标记

1.1Jupyter notbook 的使用

4.显示行号

1.1Jupyter notbook 的使用

5.输出不同的文件格式

1.1Jupyter notbook 的使用

6.在Pycharm里使用Jupyter

(1)新建jupyter文件

1.1Jupyter notbook 的使用

(2)提示输入端口

当我们点击运行的时候,会提示我们输入jupyter网页的端口,可以是网页端的,也可以是本地的。

1.1Jupyter notbook 的使用

(3)启动jupyter,复制到弹出框

1.1Jupyter notbook 的使用

(4)运行成功

1.1Jupyter notbook 的使用

(五)常用快捷键

1.查看快捷键

1.1Jupyter notbook 的使用

1.1Jupyter notbook 的使用

2.快捷键

  1. shift + Enter 运行并选中下一行

一下代码运在命令状态下有效

  1. a 在上面新建一行
  2. b 在下面新建一行
  3. x 或者 dd 删除一行
  4. ESC 退出编辑状态
  5. Enter 进入编辑状态
  6. m Markdown模式(笔记)
  7. y Code模式(代码)