Abstract:jupyter notebook新手入门指南。
入门指南
1.终端运行jupyter notebook命令,会自动打开网页
2.新建一个notebook:点击new,选择你希望启动的notebook类型(本文新建一个.py文件为例)
3.在单元格中可输入任意代码并执行,如输入1+2并按下shift+Enter,则单元格中的代码会被计算,光标也会被移动到一个新的单元格中
4.插入其他类型的单元格:Insert——>Insert Cell Above; Cell——>Cell Type——>Markdown,输入markdown格式的文本,然后Cell——>Run Cells,即可看到渲染后的解释文本
5.单元格操作:
删除:Edit——>Delete Cells
移动:Edit——>Move cell [up|down]
剪贴:Edit——>Cut Cell / Paste Cell
合并:Edit——>Merge Cell[Above|below]
6.markdown高级用法:
执行HTML代码:
<img src="https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/w%3D400/sign=d1db22fb45a7d933bfa8e5739d4ad194/4bed2e738bd4b31c59698c5480d6277f9f2ff88c.jpg">
支持LaTex语法:
$$\int_0^{+\infty} x^2 dx$$
7.导出功能:File——>Download as(可导出成多种格式:HTML,Markdown,ReST,PDF,Raw Python)
8.Matplotlib集成:
pip install matplotlib
%matplotlib inline
import matplotlib.pyplot as plt import numpy as np x = np.arange(20) y = x**2 plt.plot(x, y)
以上是绘制方程式y=x_2的代码。
9.远程访问
默认jupyter是本地访问的,若要远程访问,可通过修改配置文件的方式实现,具体操作可参照Jupyter notebook在mac:linux上的配置和远程访问
REFERENCE
btw:欢迎关注 ~
Github: https://github.com/ScarlettYellow
个人博客:https://scarletthuang.cn/