Spaces:
Runtime error
Runtime error
course schedule
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ def read_excel_and_process(fi):
|
|
| 23 |
new_data[t][d] = []
|
| 24 |
|
| 25 |
for sheet_name in excel_file.sheet_names:
|
| 26 |
-
print(f"Processing sheet: {sheet_name}")
|
| 27 |
|
| 28 |
df = excel_file.parse(sheet_name)
|
| 29 |
|
|
@@ -54,7 +54,7 @@ def read_excel_and_process(fi):
|
|
| 54 |
data_2.append(v)
|
| 55 |
|
| 56 |
df = pd.DataFrame.from_dict(data_2)
|
| 57 |
-
df.to_excel(
|
| 58 |
return "visualization.xlsx"
|
| 59 |
|
| 60 |
|
|
@@ -72,19 +72,20 @@ def read_excel_and_process(fi):
|
|
| 72 |
|
| 73 |
with gr.Blocks() as demo:
|
| 74 |
|
| 75 |
-
with gr.Tab("Course Schedule Visualization"):
|
| 76 |
-
gr.Markdown("### Visualize your course schedule.")
|
| 77 |
|
| 78 |
-
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
|
|
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
|
| 89 |
|
| 90 |
demo.launch()
|
|
|
|
| 23 |
new_data[t][d] = []
|
| 24 |
|
| 25 |
for sheet_name in excel_file.sheet_names:
|
| 26 |
+
# print(f"Processing sheet: {sheet_name}")
|
| 27 |
|
| 28 |
df = excel_file.parse(sheet_name)
|
| 29 |
|
|
|
|
| 54 |
data_2.append(v)
|
| 55 |
|
| 56 |
df = pd.DataFrame.from_dict(data_2)
|
| 57 |
+
df.to_excel("visualization.xlsx", index=False)
|
| 58 |
return "visualization.xlsx"
|
| 59 |
|
| 60 |
|
|
|
|
| 72 |
|
| 73 |
with gr.Blocks() as demo:
|
| 74 |
|
| 75 |
+
# with gr.Tab("Course Schedule Visualization"):
|
|
|
|
| 76 |
|
| 77 |
+
gr.Markdown("## Visualize your course schedule.")
|
| 78 |
|
| 79 |
+
ex_fi = gr.File(file_count='single')
|
| 80 |
+
|
| 81 |
+
result_fi = gr.File(file_count='single')
|
| 82 |
+
|
| 83 |
+
# upload to process
|
| 84 |
+
ex_fi.upload(read_excel_and_process, inputs=ex_fi, outputs=result_fi)
|
| 85 |
|
| 86 |
+
# click to process
|
| 87 |
+
# btn_submit = gr.Button("Submit")
|
| 88 |
+
# btn_submit.click(text_to_neo4j, inputs=[remarks, columns], outputs=[result_fi,result_ta])/
|
| 89 |
|
| 90 |
|
| 91 |
demo.launch()
|