Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pretty output of dataframe in Jupyter

I have two installation of iPython notebook on a remote ubuntu and on a local osx. And when I try to output pandas data frame I got the different output. See screenshots.

Jupyter (ubuntu): IPython (osx):

I want pretty tables on ubuntu in jupyter.

What should I do? I've searched a lot, but found nothing.

like image 814
Sukhanov Niсkolay Avatar asked Jan 07 '23 19:01

Sukhanov Niсkolay


1 Answers

In addition to the ones above there is another nice tool [IpyTable][1]

# create dummy data:
import pandas as pd
from numpy.random import randn, randint
df = pd.DataFrame({'a': randn(1000), 'b': randn(1000),'N': randint(100, 1000, (1000)), 'x': 'x'})

from ipy_table import make_table, set_row_style
#apply_theme('basic')
table = make_table(df[0:10].values.tolist(), len(df.columns))
set_row_style(0, color='lightGreen')
table

enter image description here

like image 62
PlagTag Avatar answered Jan 17 '23 10:01

PlagTag