basic-dataframe / app.py
hmb's picture
hmb HF Staff
Create app.py
7826116 verified
raw
history blame contribute delete
748 Bytes
import gradio as gr
df_headers = ["Name", "Population", "Size (min cm)", "Size (max cm)", "Weight (min kg)", "Weight (max kg)", "Lifespan (min years)", "Lifespan (max years)"]
df_data = [
["Irish Red Fox", 185000, 48, 92, 4.2, 6.8, 3, 5],
["Irish Badger", 95000, 62, 88, 8.5, 13.5, 6, 8],
["Irish Otter", 13500, 58, 98, 5.5, 11.5, 9, 13]
]
with gr.Blocks() as demo:
df = gr.Dataframe(
label="Irish Wildlife",
value=df_data,
headers=df_headers,
interactive=True,
show_search="search",
show_copy_button=True,
show_fullscreen_button=True,
show_row_numbers=True,
pinned_columns=1,
static_columns=[0],
column_widths=["300px"]
)
demo.launch()