我想在浏览器中增加ipython笔记本的宽度。我有一个高分辨率的屏幕,我想扩大单元格的宽度/大小,以利用这个额外的空间。
谢谢!
编辑/回答:2017年5月
我现在使用jupyterthemes: https://github.com/dunovank/jupyter-themes
还有这命令:
jt -t oceans16 -f roboto -fs 12 -cellw 100%
这设置宽度为100%与一个漂亮的主题。
我想在浏览器中增加ipython笔记本的宽度。我有一个高分辨率的屏幕,我想扩大单元格的宽度/大小,以利用这个额外的空间。
谢谢!
编辑/回答:2017年5月
我现在使用jupyterthemes: https://github.com/dunovank/jupyter-themes
还有这命令:
jt -t oceans16 -f roboto -fs 12 -cellw 100%
这设置宽度为100%与一个漂亮的主题。
当前回答
我对@jvd10的解决方案做了一些修改。“!important'似乎太强了,当TOC侧栏显示时,容器不能很好地适应。我删除了它,并添加了“min-width”来限制最小宽度。
这是我的。juyputer/custom/custom.css:
/* Make the notebook cells take almost all available width and limit minimal width to 1110px */
.container {
width: 99%;
min-width: 1110px;
}
/* Prevent the edit cell highlight box from getting clipped;
* important so that it also works when cell is in edit mode*/
div.cell.selected {
border-left-width: 1px;
}
其他回答
我对@jvd10的解决方案做了一些修改。“!important'似乎太强了,当TOC侧栏显示时,容器不能很好地适应。我删除了它,并添加了“min-width”来限制最小宽度。
这是我的。juyputer/custom/custom.css:
/* Make the notebook cells take almost all available width and limit minimal width to 1110px */
.container {
width: 99%;
min-width: 1110px;
}
/* Prevent the edit cell highlight box from getting clipped;
* important so that it also works when cell is in edit mode*/
div.cell.selected {
border-left-width: 1px;
}
对于Chrome用户,我推荐Stylebot,它可以让你覆盖任何页面上的任何CSS,也可以让你搜索和安装其他共享自定义CSS。然而,出于我们的目的,我们不需要任何提前的主题。打开Stylebot,更改为编辑CSS。Jupyter捕获了一些击键,因此您将无法键入下面的代码。只需复制粘贴,或只需你的编辑器:
#notebook-container.container {
width: 90%;
}
改变宽度随你喜欢,我发现90%看起来比100%更好。但这完全取决于你的眼睛。
是时候使用jupyterlab了
笔记本电脑终于迎来了迫切需要的升级。默认情况下,Jupyterlab使用窗口的全宽度,就像任何其他成熟的本地IDE一样。
你所要做的就是:
pip install jupyterlab
# if you use conda
conda install -c conda-forge jupyterlab
# to run
jupyter lab # instead of jupyter notebook
这是来自blog.Jupyter.org的截图
为了让它与jupyter(版本4.0.6)一起工作,我创建了~/.jupyter/custom/custom.css,其中包含:
/* Make the notebook cells take almost all available width */
.container {
width: 99% !important;
}
/* Prevent the edit cell highlight box from getting clipped;
* important so that it also works when cell is in edit mode*/
div.cell.selected {
border-left-width: 1px !important;
}
我尝试了所有的方法,没有什么对我有用,我最终使用如下HTML显示我的数据帧
from IPython.display import HTML
HTML (pd.to_html())