'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?



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Worldmaster