Jupyter notebook and Octave kernel installation

Jupyter notebook 安装

为了更加方便地写 Python 代码,还需要安装 Jupyter notebook。
利用 pip 安装 Jupyter notebook。
为什么要使用 Jupyter?参考: https://www.zhihu.com/question/37490497
Jupyter notebook: 一个交互式笔记本,支持运行 40 多种编程语言。
利用她来写 Python,代码和运行结果都可以保存下载,十分方便。

Open cmd

cd E:\Python\Python36\Scripts
pip install jupyter

配置自己的workspace
jupyter notebook --generate-config

打开 ".jupyter" 文件夹,可以看到里面有个配置文件
修改 ".jupyter\jupyter_notebook_config.py"
c.NotebookApp.notebook_dir = 'E:\Python\jupyter-notebook'

启动
jupyter notebook

然后就可以在浏览器中看到 notebook的界面了。

Octave 安装 for Jupyter Notebook

Matlab实在太贵,所以 Andrew Ng 推荐的完全开源免费的 Octave 是个好的替代物。

关于为什么要用Octave,而不是用别的Matlab代替品如Freemat, Spider等,这篇AskUbuntu里有非常详尽的解答。
简而言之:Octave是Matlab毫无疑问的最好代替品,语法相似性达95%以上,功能完善,且社区、文档非常详尽。
反之其它代替品,则要不就语法相似度低、要不就功能不全、要不就几乎没有文档学习参考。

download Octave
http://wiki.octave.org/Octave_for_Microsoft_Windows

在本机已安装Octave、Jupyter的情况下,进入Jupyter notebook的运行环境(系统或虚拟环境),输入这些命令安装:

pip install metakernel
pip install octave_kernel
python -m octave_kernel install

then, 添加 Octave 的环境变量 OCTAVE_EXECUTABLE= where is octave installed

扫描二维码关注公众号,回复: 6257209 查看本文章

then, 重启Jupyter就可以看到多了一个Octave kernel了。

猜你喜欢

转载自www.cnblogs.com/keyshaw/p/10890463.html
今日推荐