Dash DataTable not showing data

Hi,

I am trying to use DataTable with a very simple example:

df = pd.DataFrame({'Temperature': [1],'Desorption': [0.0],'Integral': [2.0]},index=['row1'])
dash_table.DataTable(
            id='table',
            columns=[{"name": "Temperature (°C)", "id": 0},{"name": "Desorption (%/g)", "id": 1},{"name": "Integral", "id": 2}],
            data=df.to_dict('records'),
        )

This does produce a table with the correct number of one row, however no data is displayed in the table. The only thing I found online was a similar issue that arose from an old Pandas version, however I am using 1.0.5 so that shouldn’t apply in my case. What am I doing wrong here?

Hi @Illmatic

If you use the column headings from the df (ie “Temperature”) rather than 0 as the “id” the table will show up

Hi @AnnMarieW,

thanks that solved my issue!

1 Like