ethanLeaderboard / app /ui /component /df_component.py
smile
Update to V0.1
8772b50
raw
history blame contribute delete
513 Bytes
import pandas as pd
import gradio as gr
from app.backend.data_engine import DataEngine
class DataFrameComponent:
def __init__(self, data_engine: DataEngine):
self.data_engine = data_engine
def show(self, df=None):
with gr.Row():
# Create DataFrame display area
if df is None:
df = self.data_engine.init_dataframe()
print(df)
df_display = gr.DataFrame(df, col_count=(len(df.columns), 'fixed'))
return df_display