Pandas df into app table

So, I’m trying to convert a Pandas dataframe into a app table, does anyone know how is that possible?

Welcome, @lzgustavo.passos !

I think the usual approach is to convert the DataFrame into a list of dicts first, then add them row-by-row by looping over them doing add_row:

import pandas as pd

df=pd.DataFrame(my_dict)
list_of_dicts=df.to_dict('records') # converting to list of dicts

for d in list_of_dicts:
    app_tables.my_table.add_row(**d)

I’ve taken that code block directly from this post, you might find more details there.

2 Likes