How to create gradio filters and multiple interfaces inside a single dataframe?
I have a function where i want to show the user the option to filter on id1 and then get relevant id2 and other metadata frames.How can i achieve this? what mistake am i making in my code?Code below:def inv(id1,id2):action_id1 = 1_df[1_df[‘id1’]==id1].iloc[:,2:]action_main = main_df2[main_df2[‘id2’] ==id2].iloc[:,2:]action_1= 1_df[1_df[‘id2’] ==id2].iloc[:,2:]action_2= 2_df[2_df[‘id2’] ==id2].iloc[:,2:]action_3= 3_df[3_df[‘id2’] ==id2].iloc[:,2:]action_4= 4_df[4_df[‘id2’] ==id2].iloc[:,2:]action_5= 5_df[5_df[‘id2’] ==id2].iloc[:,2:]action_6= 6_df[6_df[‘id2’] ==id2].iloc[:,2:]action_7= 7_df[7_df[‘id2’] ==id2].iloc[:,2:]action_8= 8_df[8_df[‘id2’] ==id2].iloc[:,2:]action_9= 9_df[9_df[‘id2’] ==id2].iloc[:,2:]action_10= 10_df[10_df[‘id2’] ==id2].iloc[:,2:]action_11= 11_df[11_df[‘id2’] ==id2].iloc[:,2:]action_12= 12_df[12_df[‘id2’] ==id2].iloc[:,2:]return (action_main,action_1, action_2, action_3, action_4, action_5, action_6,action_7, action_8, action_9, action_10, action_11, action_12)demo = gr.Blocks(css=“”"body {background-color:#f9b734!important}“”")with demo:gr.Markdown(“”"# Welcome To InterfacePlease select id1 and then select id2“”")id1_id=list_id=for i in 1_df[‘id1’].unique():id1_id.append(i)input1 = gr.Dropdown(id1_id)for j in main_df2[‘id2’].unique():list_id.append(j)input2 = gr.Dropdown(list_id)btn = gr.Button(“Submit”)output = [gr.Dataframe(),gr.Dataframe(),gr.Dataframe(),gr.Dataframe(),gr.Dataframe(),gr.Dataframe(),gr.Dataframe(),gr.Dataframe(),gr.Dataframe(),gr.Dataframe(),gr.Dataframe(),gr.Dataframe(),gr.Dataframe()]btn.click(fn=fn, inputs=[input1,input2], outputs=output)demo.launch()