My bar chart uses df.columns
for x and df.iloc[0]
values of each column for y axis.
I want the bar to be red if the value in that column is >=100.
There is a marker_colors example here but without conditions: https://plotly.com/python/bar-charts/#colored-and-styled-bar-chart
I tried this
#style chart
colors = ['lightslategray'] * len(list(elems_df.columns))
elems_cols = list(elems_df.columns)
fig_elems = go.Figure([go.Bar(x=list(elems_df.columns),
y=list(elems_df.iloc[0]),
marker_colors=[x for x in colors if
elems_df.loc[0,col] <100
for col in elems_cols else 'crimson'])])
but getting a βstatement expectedβ around βelseβ.
How can I do this?