Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter pandas.DataFrame output table format configuration

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

Now it looks like this:

enter image description here

I wish it could look like: enter image description here

like image 890
Indominus Avatar asked Feb 15 '18 00:02

Indominus


1 Answers

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.

like image 139
ZaxR Avatar answered Oct 28 '22 21:10

ZaxR