Spaces:
Sleeping
Sleeping
File size: 523 Bytes
57b138a c386cc2 57b138a c386cc2 57b138a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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) |