mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
15 lines
353 B
Python
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()
|