Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,11 +5,12 @@ import io
|
|
| 5 |
def read_csv(csv_file):
|
| 6 |
# Convert uploaded file data to pandas DataFrame
|
| 7 |
df = pd.read_csv(csv_file.name)
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
iface = gr.Interface(fn=read_csv,
|
| 11 |
inputs=gr.File(label="Upload CSV file"),
|
| 12 |
-
outputs="dataframe",
|
| 13 |
title="CSV File Reader",
|
| 14 |
description="Upload a CSV file and read its contents.")
|
| 15 |
iface.launch(debug=True)
|
|
|
|
| 5 |
def read_csv(csv_file):
|
| 6 |
# Convert uploaded file data to pandas DataFrame
|
| 7 |
df = pd.read_csv(csv_file.name)
|
| 8 |
+
df.to_csv("result.csv")
|
| 9 |
+
return df,"result.csv"
|
| 10 |
|
| 11 |
iface = gr.Interface(fn=read_csv,
|
| 12 |
inputs=gr.File(label="Upload CSV file"),
|
| 13 |
+
outputs=["dataframe",gr.File(label="result")],
|
| 14 |
title="CSV File Reader",
|
| 15 |
description="Upload a CSV file and read its contents.")
|
| 16 |
iface.launch(debug=True)
|