Jupyter pandas.DataFrame输出表格式配置 [英] Jupyter pandas.DataFrame output table format configuration

查看:1232
本文介绍了Jupyter pandas.DataFrame输出表格式配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,我在哪里可以配置Jupyter使DataFrame对象显示为全边框表?

Where can I configure Jupyter to make a DataFrame object appear as a full-bordered table by default?

现在看起来像这样:

我希望它看起来像:

I wish it could look like:

推荐答案

您可以将以下代码添加到笔记本中,该代码将应用于当前笔记本中的所有单元格,而不管其输入了什么单元格:

You can add the following code to your notebook, which will apply to all cells in the current notebook regardless of what cell it's entered in:

%%HTML
<style type="text/css">
    table.dataframe td, table.dataframe th {
        border-style: solid;
    }
</style>

如果要将其应用于所有笔记本,则可以添加自定义config/css文件.有关如何执行此操作的答案,请参见

If you want it to apply to all notebooks, you can add a custom config/css file. Answers on how to do that can be found here.

您可能还想探索 jupyterthemes ,具体取决于您要执行多少其他配置.

You might also want to explore jupyterthemes depending on how much other configuration you want to do.

这篇关于Jupyter pandas.DataFrame输出表格式配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆