Jupyter的安装和使用
Prerequisite: Python
While Jupyter runs code in many programming languages, Python is a requirement (Python 3.3 or greater, or Python 2.7) for installing the Jupyter Notebook itself.
Installing Jupyter using Anaconda
We strongly recommend installing Python and Jupyter using the Anaconda Distribution, which includes Python, the Jupyter Notebook, and other commonly used packages for scientific computing and data science.
First, download Anaconda. We recommend downloading Anaconda’s latest Python 3 version.
Second, install the version of Anaconda which you downloaded, following the instructions on the download page.
Congratulations, you have installed Jupyter Notebook! To run the notebook, run the following command at the Terminal (Mac/Linux) or Command Prompt (Windows):
jupyter notebook
See Running the Notebook for more details.
Installing Jupyter with pip
As an existing or experienced Python user, you may wish to install Jupyter using Python’s package manager, pip, instead of Anaconda.
If you have Python 3 installed (which is recommended):
python3 -m pip install --upgrade pip
python3 -m pip install jupyter
If you have Python 2 installed:
python -m pip install --upgrade pip
python -m pip install jupyter
Congratulations, you have installed Jupyter Notebook! To run the notebook, run the following command at the Terminal (Mac/Linux) or Command Prompt (Windows):
jupyter notebook
See Running the Notebook for more details.
Jupyter Notebook(此前被称为 IPython notebook)是一个交互式笔记本,支持运行 40 多种编程语言。
Jupyter Notebook 的本质是一个 Web 应用程序,便于创建和共享文学化程序文档,支持实时代码,数学方程,可视化和 markdown。 用途包括:数据清理和转换,数值模拟,统计建模,机器学习等等
Jupyter Notebook使用方法
安装完Anaconda后,点击开始菜单,找到Anaconda下的Jupyter Notebook
首先打开Anaconda,Home—Jupyter notebook—Launch;
Environments — base(root) — open with jupyter notebook
或者Open with Terminal,输入jupyter notebook 或者直接win+R 运行cmd 输入jupyter notebook 理解Anaconda提供服务了,才可以打开Jupyter Notebook
ipynb怎么打开
ipynb,即ipython notebook,就是现在的Jupyter Notebook文件
直接拖至默认目录下即可 比如我的是C:\Users\Administrator
制作一个bat文件,将所有ipynb文件打开方式设置为这个文件https://blog.csdn.net/qq_18649781/article/details/79756631
链接:https://www.zhihu.com/question/45498930/answer/155661267
三种方法查看 .ipynb 文件:
1,GitHub 中可以直接打开 .ipynb 文件。
2,可以把 .ipynb 文件对应的下载链接复制到 https://nbviewer.jupyter.org/ 中查看。
3,安装 Anaconda,从开始菜单中打开 jupyter notebook 的快捷方式(prompt 中用该命令打开同理),默认启动路径在 C:\Users\yourname 类似的文件夹。把 .ipynb 文件复制到这个目录下面,找到并打开即可查看。
好文:
28 Jupyter Notebook tips, tricks, and shortcuts
27 个Jupyter Notebook的小提示与技巧(译)
MAKING PUBLICATION READY PYTHON NOTEBOOKS
Seaborn is built over Matplotlib and makes building more attractive plots easier. Just by importing Seaborn, your matplotlib plots are made 'prettier' without any code modification
Using LaTeX for forumlas
When you write LaTeX in a Markdown cell, it will be rendered as a formula using MathJax.
当你在 markdown cell 中书写LaTeX时,它会被 MathJax 渲染成一个公式。
This:
\\( P(A \mid B) = \frac{P(B \mid A) \, P(A)}{P(B)} \\)
Becomes this:
Markdown is an important part of notebooks, so don't forget to use its expressiveness!
Jupyter Notebook里的两个计时命令:%%time和%%timeit.当你有一些很耗时的代码,想要查清楚问题出在哪时,这两个命令非常给力。
%%time 会告诉你 cell 内代码的单次运行时间信息。
%%timeit 使用了 Python 的 timeit 模块,该模块运行某语句 100,000 次(默认值),然后提供最快的 3 次的平均值作为结果。