单元格宽度Jupyter笔记本 - Apache Toree - Scala

时间:2017-02-02 09:01:59

标签: scala ipython-notebook jupyter-notebook spark-notebook apache-toree

如何使用Apache Toree - Scala内核增加Jupyter笔记本的单元格宽度?

通常的

from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
确实不起作用。

1 个答案:

答案 0 :(得分:2)

~/.jupyter/custom/custom.js中(以避免换行 - 水平滚动):

$([IPython.events]).on('app_initialized.NotebookApp', function(){
  IPython.CodeCell.options_default['cm_config']['lineWrapping'] = true;
});

并在~/.jupyter/custom/custom.css中添加(使用所有宽度):

.container { width:100% !important; }
pre, code, kbd, samp {
    white-space: pre;
}

这两个技巧通过对齐列来有效地消除自动换行并为视图提供更多宽度,从而有助于使Spark SQL DataFrame show()方法更加“可口”。如果这些文件不存在,请尝试创建它们。