display datatable after filtering rows from dropdown list in dash

前端 未结 1 1038
迷失自我
迷失自我 2021-01-20 03:57

I\'m new to Dash. I would like to make a app, where I can select values from dropdown filter, filter dataset and display the data table. I\'m using dash_table.

My e

相关标签:
1条回答
  • 2021-01-20 04:09

    You have to set the columns of your data table and return your dataframe as a dict in a special form. So change these two lines in your code to make it work.

    dt.DataTable(id='table-container', columns=[{'id': c, 'name': c} for c in df.columns.values])
    
    return dff.to_dict('records')
    

    BTW, do anyone know where I can find collections of dash app gallery with code?

    Best place with lots of examples with code is the Dash User Guide. You can for instance find the data table there.

    0 讨论(0)
提交回复
热议问题