Spaces:
Sleeping
Sleeping
import gradio as gr | |
import pandas as pd | |
import io | |
def read_csv(csv_file): | |
# Convert uploaded file data to pandas DataFrame | |
content = csv_file.getvalue().decode('utf-8') | |
df = pd.read_csv(io.StringIO(content)) | |
return df | |
iface = gr.Interface(fn=read_csv, | |
inputs=gr.File(label="Upload CSV file"), | |
outputs="dataframe", | |
title="CSV File Reader", | |
description="Upload a CSV file and read its contents.") | |
iface.launch(debug=True) |