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?

1 answer

  • answered 2022-05-06 16:53 Worldmaster

    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

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum