Spaces:
No application file
No application file
Download app/ui/component/df_component.py from SmileXing/ethanLeaderboard: direct link, hf CLI and curl.
- Browser
- Download file 513 Bytes
-
https://huggingface.co/spaces/SmileXing/ethanLeaderboard/resolve/main/app/ui/component/df_component.py
- Command line
-
hf download hf://spaces/SmileXing/ethanLeaderboard/app/ui/component/df_component.py
-
curl -L -o df_component.py https://huggingface.co/spaces/SmileXing/ethanLeaderboard/resolve/main/app/ui/component/df_component.py
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 | |