So, I have a dataframe that displays correctly in my Notebook but not in a *.py dash app when the datafram is loaded into a DashTable. It appears that the “Grouped By” column is not displaying in the DashTable.
Has anyone run ito this?
Here’s how it looks in my notebook:
Here’s how the DataTable looks:
Here’s how the dataframe is created:
df3 = df.groupby(‘Game_SK’).agg(np.sum)
df3[“Goal_Diff”] = (df3[“Goals”] - df3[“Goals Allowed”])
conditions = [df3[‘Goal_Diff’] > 0, df3[‘Goal_Diff’] == 0, df3[‘Goal_Diff’] < 0]
choices = [‘Win’, ‘Tie’, ‘Loss’]
df3[‘Result’] = np.select(conditions, choices)
Here’s how it’s passed to the DataFrame:
dash_table.DataTable
(
id = 'datatable2',
columns = [{"name": i, "id": i} for i in df3.columns],
data=df3.to_dict('records'),
filter_action='native',
sort_action='native',
page_size=20,
)
What am I missing? Sometype of Index property?
Thank you in advance for your insight.
Joe P.