My prices_top10 df has top brands and respective prices. I want to plot median, high, highest, low, lowest in box plot for all 10 brands, and none of these code works:
Try 1:
fig1_2 = go.Figure()
traces = list()
for brandname in prices_top10.brandname.unique():
traces.append(go.Box(y=prices_top10[prices_top10.brandname == brandname].price.tolist(),
name = brandname
)
)
fig1_2.add_traces(traces)
fig.append_trace(traces, 2, 1)
Try 2:
fig1_2 = go.Figure()
traces = list()
for brandname in prices_top10.brandname.unique():
fig1_2.add_trace(go.Box(y=prices_top10[prices_top10.brandname == brandname].price.tolist(),
name = brandname
)
)
fig.append_trace(fig1_2, 2, 1)