gradio/demo/records.py

15 lines
353 B
Python
Raw Normal View History

2020-08-06 01:42:52 +08:00
import gradio as gr
import numpy as np
import random
def filter_records(records, gender):
return records[records['gender'] == gender]
gr.Interface(filter_records,
[
gr.inputs.Dataframe(headers=["name", "age", "gender"], datatype=["str", "number", "str"], row_count=5),
gr.inputs.Dropdown(["M", "F", "O"])
],
"dataframe"
).launch()