Created
July 26, 2024 03:00
-
-
Save NhuanTDBK/638df381dd631429fc03ef8133b3081b to your computer and use it in GitHub Desktop.
Gradio quick preview dataframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gradio as gr | |
import pandas as pd | |
import random | |
def get_random_data(): | |
return df.sample(10) | |
def display_data(): | |
df = get_random_data() | |
return df.to_html(escape=False) | |
iface = gr.Interface( | |
fn=display_data, | |
inputs=[], | |
outputs="html", | |
title="Preview of Cleaned Data", | |
description="This UI displays a random selection of data frame", | |
) | |
iface.launch() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment