majkrzak
majkrzak

Reputation: 1547

Display interactive table

Is it possible in jupyter to display tabular data in some interactive format?

So that for example following data

A,x,y
a,0,0
b,5,2
c,5,3
d,0,3

will be scrollable and sortable by A,x and y columns?

Upvotes: 1

Views: 2803

Answers (1)

Worldmaster
Worldmaster

Reputation: 250

Yes, it is possible. First install itables

!pip install itables

In the next step import module and turn on interactive mode:

from itables import init_notebook_mode
init_notebook_mode(all_interactive=True)

Let's load your data to pandas dataframe:

data = {
    'A' : ['a', 'b', 'c', 'd'],
    'x' : [0, 5, 5, 0],
    'y' : ['0', '2', '3', '3'],
    }
   
df = pd.DataFrame(data)
df

see the result

Upvotes: 3

Related Questions