Jupyter Notebook 使用小技巧
2017-11-29 14:16
603 查看
小 Tips:
在
Jupyter Notebook的27个秘诀,技巧和快捷键
下面是在 Jupyter Notebook 的 Markdown 模式:
展示如下:
Hello world
黑体: Hello world
STCAIYUN: hello world
Terminal: Hello world
Consolas: Hello world
Consolas,2,#DC143C: Hello world
<font face="Consolas" size=4 color=(220, 20, 60)> Consolas,2,(220, 20, 60): Hello world
Consolas,2,Crimson: Hello world
Consolas,2,Crimson: Hello world
展示如下:
\[
f(x;\mu,\sigma^2) = \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2 } \tag{1}
\]
where \(\mu\) is the mean value, \(\sigma^2\) is standard deviation.
一些基本的LaTeX公式命令可参考:Markdown公式(二)
下面说下矩阵和表达式:
展示如下
\[
\left[ \begin{matrix}
b_{1}&c_{1}& & & &0 \\
a_{2}&b_{2}&c_{2}& & & \\
&a_{3}&b_{3}&\ddots& & \\
& &\ddots&\ddots&c_{n-1} & \\
0& & & &a_{n}&b_{n}
\end{matrix}\right]
\left[ \begin{matrix}
x_{1} \\
x_{2} \\
x_{3} \\
\vdots\\
x_{n}
\end{matrix}\right] =
\left[ \begin{matrix}
d_{1} \\
d_{2} \\
d_{3} \\
\vdots\\
d_{n}
\end{matrix}\right]
\tag{2}
\]
\[ c'_i =
\begin{cases}
\begin{array}{lcl}
\cfrac{c_i}{b_i} & & ; i = 1 \\
\cfrac{c_i}{b_i - a_i c'_{i - 1}} & & ; i = 2, 3, \dots, n-1 \\
\end{array}
\end{cases}
\tag{3}
\]
MarkDown里显示图片的方式可以引入 HTML 方法:
直接以MarkDown插入图片的方法,图片就会靠在左侧,大小也不由自己决定:
其中
更多的操作见:图片的操作
=====================================================================================================================================
基于 Ipython:Jupyter Notebooks 使用新技能
将 GitHub 放到 notebooks
=====================================================================================================================================
在
C:\Windows\Fonts目录下找到
Mircosoft YaHei UI字体,然后复制到
[你的Python安装路径]/Lib/site-packages/matplotlib/mpl-data/fonts/ttf目录下即可解决
Matplotlib中文乱码的问题。
Jupyter Notebook的27个秘诀,技巧和快捷键
下面是在 Jupyter Notebook 的 Markdown 模式:
1 字体、颜色、字号
Markdown 全篇是统一使用黑色微软雅黑字体,字号默认为 \(3\),而 HTML 却可以像 Word 那样灵活,引入大量字体包、颜色和字号,例如在 Markdown:Hello world - <font face="黑体"> 黑体: Hello world </font> - <font face="STCAIYUN"> STCAIYUN: hello world </font> - <font face="Terminal"> Terminal: Hello world </font> - <font face="Consolas"> Consolas: Hello world </font> - <font face="Consolas" size=3 color=#DC143C> Consolas,2,#DC143C: Hello world </font> - <font face="Consolas" size=4 color=(220, 20, 60)> Consolas,2,(220, 20, 60): Hello world </font> - <font face="Consolas" size=5 color=Crimson> Consolas,2,Crimson: Hello world </font> - <font face="Consolas" size=7 color=#0099ff> Consolas,2,Crimson: Hello world </font>
展示如下:
Hello world
黑体: Hello world
STCAIYUN: hello world
Terminal: Hello world
Consolas: Hello world
Consolas,2,#DC143C: Hello world
<font face="Consolas" size=4 color=(220, 20, 60)> Consolas,2,(220, 20, 60): Hello world
Consolas,2,Crimson: Hello world
Consolas,2,Crimson: Hello world
font主要包含三个参数:字体(
face),字号(
size)和颜色(
color),顺序可调,也可缺省。
size的可选范围为
1-7,小于 \(1\) 的数值等价于 \(1\),超过\(7\)的数值等价于\(7\));
color的赋值既可以使用颜色名,例如
Blue,
Black,
Crimson等,也可以使用十六进制的颜色值
#0000FF,
#000000,
#DC143C等,如果想了解更多,可以阅读博客:CSDN-markdown编辑器语法——字体、字号与颜色。
2 数学字符及公式
再来看数学字符及公式,MarkDown 中使用标识符$$和
$$$$即可表示引入 LaTeX 语法,前者使用时不换行,即在所使用位置使用 LaTeX 的格式,后者会换行后居中,例如:
$$ f(x;\mu,\sigma^2) = \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2 } \tag{1} $$ where $\mu$ is the mean value, $\sigma^2$ is standard deviation.
展示如下:
\[
f(x;\mu,\sigma^2) = \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2 } \tag{1}
\]
where \(\mu\) is the mean value, \(\sigma^2\) is standard deviation.
一些基本的LaTeX公式命令可参考:Markdown公式(二)
下面说下矩阵和表达式:
$$ \left[ \begin{matrix} b_{1}&c_{1}& & & &0 \\ a_{2}&b_{2}&c_{2}& & & \\ &a_{3}&b_{3}&\ddots& & \\ & &\ddots&\ddots&c_{n-1} & \\ 0& & & &a_{n}&b_{n} \end{matrix}\right] \left[ \begin{matrix} x_{1} \\ x_{2} \\ x_{3} \\ \vdots\\ x_{n} \end{matrix}\right] = \left[ \begin{matrix} d_{1} \\ d_{2} \\ d_{3} \\ \vdots\\ d_{n} \end{matrix}\right] \tag{2} $$ $$ c'_i = \begin{cases} \begin{array}{lcl} \cfrac{c_i}{b_i} & & ; i = 1 \\ \cfrac{c_i}{b_i - a_i c'_{i - 1}} & & ; i = 2, 3, \dots, n-1 \\ \end{array} \end{cases} \tag{3}$$ $$
展示如下
\[
\left[ \begin{matrix}
b_{1}&c_{1}& & & &0 \\
a_{2}&b_{2}&c_{2}& & & \\
&a_{3}&b_{3}&\ddots& & \\
& &\ddots&\ddots&c_{n-1} & \\
0& & & &a_{n}&b_{n}
\end{matrix}\right]
\left[ \begin{matrix}
x_{1} \\
x_{2} \\
x_{3} \\
\vdots\\
x_{n}
\end{matrix}\right] =
\left[ \begin{matrix}
d_{1} \\
d_{2} \\
d_{3} \\
\vdots\\
d_{n}
\end{matrix}\right]
\tag{2}
\]
\[ c'_i =
\begin{cases}
\begin{array}{lcl}
\cfrac{c_i}{b_i} & & ; i = 1 \\
\cfrac{c_i}{b_i - a_i c'_{i - 1}} & & ; i = 2, 3, \dots, n-1 \\
\end{array}
\end{cases}
\tag{3}
\]
3 图片排版
MarkDown 图片大小问题
引用自:文章链接: http://blog.csdn.net/yhl_leo/article/details/50099843MarkDown里显示图片的方式可以引入 HTML 方法:
直接以MarkDown插入图片的方法,图片就会靠在左侧,大小也不由自己决定:
![雷姆](http://static.zybuluo.com/xinet/dk25o6spbuvf486y2kh8b7oq/%E9%9B%B7%E5%A7%86.PNG)
固定图片显示大小:
<img src="http://static.zybuluo.com/xinet/dk25o6spbuvf486y2kh8b7oq/%E9%9B%B7%E5%A7%86.PNG" width=256 height=256 />
其中
src后面接的就是图像对象,
width和
height设置的是显示图像的尺寸。
更多的操作见:图片的操作
=====================================================================================================================================
基于 Ipython:Jupyter Notebooks 使用新技能
将 GitHub 放到 notebooks
=====================================================================================================================================
相关文章推荐
- jupyter notebook的安装与使用
- Jupyter Notebook 快捷键使用指南
- Anaconda集成的Jupyter notebook消失,该如何使用Jupyter?
- 使用ssh搭建jupyter notebook服务器
- Jupyter Notebook使用笔记(二)
- 在jupyter notebook下使用, 安装在virtualenv下的tensorflow
- 使用bat打开Jupyter Notebook
- jupyter notebook使用方法
- Jupyter Notebook使用笔记
- Jupyter Notebook 使用IE打开显示不出界面的问题
- Jupyter Notebook 使用小结
- Jupyter Notebook 使用总结 Pycharm
- Anaconda安装配置&jupyter notebook使用
- Python·Jupyter Notebook各种使用方法记录·持续更新
- 使用pelican搭建一个Jupyter Notebook数据科学博客
- Jupyter Notebook介绍、安装及使用教程
- 在Jupyter notebook和spyder上用python做数据挖掘,安装使用简介和常见错误
- Jupyter notebook 安装,初步使用
- 使用jupyter notebook运行paddlepaddle交互式脚本
- jupyter notebook的安装与使用