【发布时间】:2020-04-26 10:43:13
【问题描述】:
我创建了 st.selectbox/multiselect 功能,我可以在 Streamlit 中选择我的 X 轴和 Y 轴。我只为 X 轴选择一列,但是我希望有这个选项来选择多个值并能够在 Y 轴上绘制它们(使用相同的单位)。 我收到“所有参数必须具有相同大小”的错误。这是一段
代码:
all_columns_names = df.columns.tolist()
col_x = st.selectbox('Which Feature on X axis?', all_columns_names)
col_y = st.multiselect('Which Feature on Y axis?', all_columns_names)
fig = px.line(df, x =col_x,y=col_y)
st.plotly_chart(fig)
【问题讨论】: