gradio/demo/records.py
2020-08-05 10:42:52 -07:00

15 lines
353 B
Python

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()