fortuala commited on
Commit
112056c
·
verified ·
1 Parent(s): c973292

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -179,13 +179,19 @@ with gr.Blocks(title="Data Quality Scenario Explorer") as demo:
179
 
180
  # table viewer
181
  gr.Markdown("### Table 1-2 Viewer")
182
- col_in = gr.Textbox(label="Column (optional)")
183
- val_in = gr.Textbox(label="Value (optional)")
184
- tbl_btn = gr.Button("Show / Filter Table")
185
- tbl_out = gr.Dataframe()
186
 
187
- tbl_btn.click(filter_csv, [col_in, val_in], tbl_out)
188
- demo.load(lambda: filter_csv("", ""), outputs=tbl_out)
 
 
 
 
 
 
 
 
 
 
189
 
190
  if __name__ == "__main__":
191
  demo.launch()
 
179
 
180
  # table viewer
181
  gr.Markdown("### Table 1-2 Viewer")
 
 
 
 
182
 
183
+ with gr.Row():
184
+ col_dd = gr.Dropdown(label="Column",
185
+ choices=list(df_full.columns),
186
+ value=list(df_full.columns)[0])
187
+ val_tb = gr.Textbox(label="Filter value (optional)")
188
+ apply_b = gr.Button("Apply Filter")
189
+ reset_b = gr.Button("Show All")
190
+
191
+ table_df = gr.Dataframe(value=df_full, label="table_1_2.csv")
192
+
193
+ apply_b.click(filter_csv, [col_dd, val_tb], table_df)
194
+ reset_b.click(lambda: df_full, None, table_df)
195
 
196
  if __name__ == "__main__":
197
  demo.launch()