Jupyter pandas.DataFrame output table format configuration

后端 未结 1 1516
既然无缘
既然无缘 2020-12-14 13:07

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

Now it looks like this:

I wish

相关标签:
1条回答
  • 2020-12-14 13:27

    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>
    

    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.

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

    0 讨论(0)
提交回复
热议问题