Github JupyterLab
1. 启动JupyterLab
--... --- ---
--ip=0.0.0.0 监听所有ip,允许其他电脑访问 --no-brower 不启动本地浏览器 --notebook-dir 指定根目录
注:发现还是jupyter notebook比jupyter lab好用一些,前者允许notebook中的markdown文本引用目录下的图片等资源,而jupyter lab则可能是增强了安全控制,禁止引用本地资源
2.设置密码登录
Running a notebook server
3.隐藏代码导出html
-- --. --
–post serve 可以通过127.0.0.1:8000访问html文件 –template=hidecode.tpl 隐藏python代码
hidecode.tpl
{% extends 'full.tpl'%}
{% block input_group -%}
{% endblock input_group %}
tpl语法参考Customizing nbconvert
4.嵌入显示matplotlib结果
%matplotlib inline
import matplotlib.pyplot
as plt
import numpy
x=numpy.arange(-
2,
2,
0.1)
plt.plot(x,numpy.sin(x))
plt.show()
5.matplotlib显示中文
from matplotlib.font_manager
import _rebuild
_rebuild()
import matplotlib
matplotlib.rcParams[
'font.family']=[
'Microsoft YaHei']
plt.title(
'中文标题')
plt.plot(x,numpy.sin(x))
plt.show()
转载请注明原文地址: https://ju.6miu.com/read-17098.html