Indominus
Indominus

Reputation: 1248

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

Upvotes: 7

Views: 9332

Answers (1)

ZaxR
ZaxR

Reputation: 5155

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.

Upvotes: 9

Related Questions