Plotly: How to filter a pandas dataframe using a dropdown menu?
问题 I have a dataframe and using plotly I want to visualise the data. I have the following code fig = px.line(df, x="row_num", y="audienceWatchRatio", color='vid_id') fig.show() It's really messy, so I want a drop-down menu where the user can just select the vid_id and it only shows the 1 graph. 回答1: You can set up one trace and a button option for each individual trace. This will turn this figure... ... into this: The button option A will be replaced with the first column in your dataframe. And