Search code examples
pandasdataframejupyter-notebookgoogle-colaboratoryvisualization

Visualising multiple tables in Pandas on Notebook


I have 4 panda dataframes in a Google Colab notebook. I would like to create an interactive table that has a dropdown menu that lets me choose which of the 4 tables to view. I am aware of iTables and the colab google.colab.data_table extension that let you have interactive tables in the notebook. I didn't see one that lets me load 4 different ones at once with a dropdown menu to pick which one to view. I was wondering if anyone knew of such an extension/feature.

Thank you


Solution

  • You can use Colab's form to make a dropdown with autorun.

    #@title {run: 'auto'}
    df_name = "df2" #@param ["df1", "df2", "df3", "df4"]
    df = globals()[df_name]
    df
    

    Here's a runnable colab example.