一、Jupyter基础
参考文档
- 具体教程见官方文档https://jupyter-notebook.readthedocs.io/en/stable/notebook.html
- 推荐看这个作者的详细中文教程https://www.jianshu.com/p/91365f343585
安装及启动
-
安装前提 安装Jupyter Notebook的前提是需要安装了Python(3.3版本及以上,或2.7版本)。
-
开发环境准备 用进入到准备开发的开发环境(参考虚拟环境搭建,使用workon进入虚拟环境)
-
安装
pip install jupyter
-
启动
① 默认端口启动
Jupyter Notebook
启动过程中终端显示内容如下:$ jupyter notebook [I 08:58:24.417 NotebookApp] Serving notebooks from local directory: /Users/catherine [I 08:58:24.417 NotebookApp] 0 active kernels [I 08:58:24.417 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/ [I 08:58:24.417 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
注意:之后在Jupyter Notebook的所有操作,都请保持终端不要关闭,因为一旦关闭终端,就会断开与本地服务器的链接,你将无法在Jupyter Notebook中进行其他操作
浏览器地址栏中默认地将会显示:http://localhost:8888。其中,“localhost”指的是本机,“8888”则是端口号。
② 指定端口启动jupyter notebook --port <port_number>
其中,“<port_number>”是自定义端口号,直接以数字的形式写在命令当中,数字两边不加尖括号“<>”。如:jupyter notebook --port 9999,即在端口号为“9999”的服务器启动Jupyter Notebook。
二、Numpy基础
参考文档
中文官方文档:https://www.numpy.org.cn/user/setting-up.html
菜鸟教程:https://www.runoob.com/numpy/numpy-tutorial.html