Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

BUG: in tables - boolean values fail to render

When I try to output raw values like True/False I get a strange error saying ‘Error loading dependencies’.

The solution is very simple encode the values to string but the error should be improved as I had to guess what was causing it.
Please see the code needed to replicate error:

Try this:
def load_data():
return pd.DataFrame({“A” : [1,2,3,4], “B” : [True,False,True,False]})

def generate_table(dataframe, max_rows=10):
return html.Table(
    # Header
    [html.Tr([html.Th(col) for col in dataframe.columns])] +

    # Body
        html.Td(dataframe.iloc[i][col]) for col in dataframe.columns
    ]) for i in range(min(len(dataframe), max_rows))]

app = dash.Dash()

app.layout = html.Div(children=[
html.H4(children='US Agriculture Exports (2011)'),

if __name__ == '__main__':
1 Like

Thanks for reporting! Tracking in

Of course, for now, you can just stringify the data before you want to plot it, i.e. str(dataframe.iloc[i][col])