一.介绍

Jupyther notebook(曾经的Ipython notebook),是一个可以把代码、图像、注释、公式和作图集于一处,实现可读性及可视化分析的工具,支持多种编程语言。官方使用手册

安装前,你需要装好python环境,并且安装pip包管理器。

二. 安装

使用pip安装jupyter notebook

Python2

pip install --upgrade pip
sudo pip install jupyter notebook

或者

python -m pip install jupyter

Python3

pip3 install --upgrade pip
sudo pip3 install jupyter notebook

或者

python3 -m pip install jupyter

运行jupyter notebook

jupyter notebook

或者

ipython notebook

三.必要环境配置

ipython profile create

此时会在你的家目录生成配置文件.ipython/profile_default/ipython_kernel_config.py

运行代码后自动显示变量值

直接在该文件的头部添加代码

c = get_config()
c.InteractiveShell.ast_node_interactivity = "all"

ipython中文编码问题

vi ~/.ipython/ipythonrc

readline_parse_and_bind "\M-i": "    "
readline_parse_and_bind "\M-o": "\d\d\d\d"
readline_parse_and_bind "\M-I": "\d\d\d\d

注释掉这3行

使用matplotlib作图显示中文

需要设置中文字体,否则中文会乱码。

import matplotlib.pyplot as plt
plt.rc('font', family='Microsoft YaHei Mono', size=12)

四.基本使用

常用快捷键

  • 在当前cell的上一层添加cell:A
  • 在当前cell的下一蹭添加cell:B
  • 双击d:删除当前cell
  • 撤销对某个cell的删除:z
  • 当前的cell进入编辑模式:Enter
  • 退出当前cell的编辑模式:Esc
  • 执行当前cell并跳到下一个cell:Shift Enter
  • 执行当前cell执行后不调到下一个cell:Ctrl Enter
  • 向下选择多个cell:Shift + J 或 Shift + Down
  • 向上选择多个cell:Shift + K 或 Shift + Up
  • 合并cell:Shift + M
  • 在代码中查找、替换,忽略输出:Esc + F
  • 在cell和输出结果间切换:Esc + O
  • 快速跳转到首个cell:Crtl Home
  • 快速跳转到最后一个cell:Crtl End
  • m:进入markdown模式,编写md的文档进行描述说明
  • 为当前的cell加入line number:单L
  • 将当前的cell转化为具有一级标题的maskdown:单1
  • 将当前的cell转化为具有二级标题的maskdown:单2
  • 将当前的cell转化为具有三级标题的maskdown:单3
  • 为一行或者多行添加/取消注释:Crtl /
  • 在浏览器的各个Tab之间切换:Crtl PgUp和Crtl PgDn

参考

https://www.zybuluo.com/hanxiaoyang/note/534296

https://zhuanlan.zhihu.com/p/26739300?group_id=843868091631955968

https://www.cnblogs.com/Sinte-Beuve/p/5148108.html

https://www.zhihu.com/question/59392251

http://www.jianshu.com/p/2f3be7781451 Anaconda使用总结

JupyterLab安装使用

JupyterLab是Jupyter Notebook的增强版本,看起来更像是一个IDE。

pip install jupyterlab

安装早版本的Jupyter Notebook

如果你使用的Jupyter版本早于5.3,那么你还需要运行以下命令来启动JupyterLab服务组件。

jupyter serverextension enable --py jupyterlab --sys-prefix

运行

使用以下命令运行JupyterLab:

jupyter lab

JupyterLab 会在自动在浏览器中打开. See our documentation for additional details.

查看令牌

jupyter notebook list

输出

http://localhost:8888/?token=c8de56fa... :: /Users/you/notebooks

您可以通过运行以下命令列出当前安装的扩展:

jupyter labextension list

通过运行以下命令卸载扩展:

jupyter labextension uninstall my-extension

其中my-extension是扩展名列表中的打印名称。您也可以使用此命令卸载核心扩展(以后可以随时重新安装核心扩展)。

参考

https://jupyterlab.readthedocs.io/en/latest/user/extensions.html

https://github.com/jupyterlab/jupyterlab#getting-help

https://gitter.im/jupyterlab/jupyterlab

http://jupyterlab.github.io/jupyterlab/

Jupyter/JupyterLab安装使用的更多相关文章

  1. JupyterLab安装与配置虚拟环境

    JupyterLab安装: 推荐使用miniconda,相比于anaconda更加简洁,下载连接:https://mirrors.tuna.tsinghua.edu.cn/anaconda/minic ...

  2. Jupyter notebook安装扩展插件

    1. 安装Jupyter Notebook pip install jupyter 2. 安装Jypyter Notebook扩展包 pip install jupyter_contrib_nbext ...

  3. Windows下的Jupyter Notebook 安装与自定义启动(图文详解)

    不多说,直接上干货! 前期博客 Windows下的Python 3.6.1的下载与安装(适合32bits和64bits)(图文详解) 这是我自定义的Python 的安装目录 (D:\SoftWare\ ...

  4. Windows下的Jupyter Notebook 安装与自定义启动

    1.Jupyter Notebook 和 pip 为了更加方便地写 Python 代码,还需要安装 Jupyter notebook. 利用 pip 安装 Jupyter notebook. 为什么要 ...

  5. 全真教程:Windows环境Jupyter Notebook安装、运行和工作文件夹配置

    全真教程:Windows环境Jupyter Notebook安装.运行和工作文件夹配置 @ 目录 全真教程:Windows环境Jupyter Notebook安装.运行和工作文件夹配置 一.Jupyt ...

  6. 1,turicreate入门 - jupyter & turicreate安装

    turicreate入门系列文章目录 1,turicreate入门 - jupyter & turicreate安装 2,turicreate入门 - 一个简单的回归模型 3,turicrea ...

  7. jupyter lab 安装

    在windows下安装jupyter 特别简单 首先你需要有Anaconda or python的环境变量,这里我就不说怎么安装环境变量了,网上一大堆教程 启动黑窗口,下载jupyter pip in ...

  8. 新上手jupyterlab安装及问题解决

    最近jupyter notebook又出了一个新玩法:jupyterlab但是很多小伙伴和我一样,在安装的时候出现了很多问题,于是乎我总结了一下,希望给大家带来帮助 首先,最好保持你的浏览器是最新的版 ...

  9. Jupyter notebook 安装,初步使用

    在学习算法,图像处理过程中,理论结合实际的时候总要写一些程序,我用的是PYTHON.这时候,选择一款称手的工具比较重要.之前我用自带的IDLE,也还可以,但是操作不够便捷,文件组织也不是很好.后来想用 ...

随机推荐

  1. 骚气男孩saochi boy 唐砖 插曲

    试听下载链接:https://pan.baidu.com/s/1ObB9FYbgzegcE25io6zCEg

  2. [CC-CMPVIRS]Computer Virus

    [CC-CMPVIRS]Computer Virus 题目大意: 有一张纸带,从左到右被分成了\(n(n\le10^7)\)个格子,在刚开始,第\(i\)个格子上写着数字\(i\).这张纸带被分成了从 ...

  3. nodejs 支付宝app支付

    [链接]单笔转账到支付宝账户产品介绍更新时间:https://docs.open.alipay.com/309 const crypto = require('crypto') const momen ...

  4. (转)nginx uwsgi wsgi django 这些东西究竟是什么关系

    有太多的文章告诉我们nginx uwsgi django 这些东西怎么用了,太多的人知道这些东西的怎么使用,怎么配置,怎么优化,但是还是有一部分人比如我这种水货不知道这些东西到底是啥,为啥一个项目的发 ...

  5. Java中map集合系列原理剖析

    看了下JAVA里面有HashMap.Hashtable.HashSet三种hash集合的实现源码,这里总结下,理解错误的地方还望指正 HashMap和Hashtable的区别 HashSet和Hash ...

  6. Ruby语法基础(三)

    Ruby语法基础(三) ​ 在前面快速入之后,这次加深对基本概念的理解. 字符串 ​ Ruby字符串可以分为单引号字符串和双引号字符串,单引号字符串效率更高,但双引号的支持转义和运行 puts '单引 ...

  7. PAT基础6-10

    6-10 阶乘计算升级版 (20 分) 本题要求实现一个打印非负整数阶乘的函数. 函数接口定义: void Print_Factorial ( const int N ); 其中N是用户传入的参数,其 ...

  8. 4989: [Usaco2017 Feb]Why Did the Cow Cross the Road

    题面:4989: [Usaco2017 Feb]Why Did the Cow Cross the Road 连接 http://www.lydsy.com/JudgeOnline/problem.p ...

  9. button标题左对齐

    Button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//左对齐(UIControlContentHo ...

  10. Linux之awk、变量、运算符、if多分支

    一.awk语法 awk [options] 'commands' filesoption-F 定义字段分隔符,默认的分隔符是连续的空格或制表符使用option中的-F参数定义间隔符号用$1,$2,$3 ...