Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -535,17 +535,18 @@ def main():
|
|
| 535 |
# # repo.git_add("ch.json")
|
| 536 |
# # repo.git_commit(commit_message="add ch.json :)")
|
| 537 |
# # repo.push()
|
| 538 |
-
|
| 539 |
-
# csv_file = "predictions.csv"
|
| 540 |
-
# #json_file = "smalljson.json"
|
| 541 |
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 545 |
|
| 546 |
# # Convert the CSV data to a list of dictionaries
|
| 547 |
data_list = []
|
| 548 |
-
for row in
|
| 549 |
data_list.append(dict(row))
|
| 550 |
|
| 551 |
# # Convert the list of dictionaries to JSON
|
|
@@ -555,7 +556,7 @@ def main():
|
|
| 555 |
# #with open("smalljson.json", "r+") as fi:
|
| 556 |
# #data = fi.read()
|
| 557 |
# #fi.seek(0)
|
| 558 |
-
with open('
|
| 559 |
data = json.load(fi)
|
| 560 |
# #st.write(data)
|
| 561 |
# # fi.seek(0)
|
|
|
|
| 535 |
# # repo.git_add("ch.json")
|
| 536 |
# # repo.git_commit(commit_message="add ch.json :)")
|
| 537 |
# # repo.push()
|
|
|
|
|
|
|
|
|
|
| 538 |
|
| 539 |
+
df_final1.to_csv('predictions.csv')
|
| 540 |
+
csv_file = "predictions.csv"
|
| 541 |
+
json_file = "detailedResults.json"
|
| 542 |
+
|
| 543 |
+
# Open the CSV file and read the data
|
| 544 |
+
with open(csv_file, "r") as f:
|
| 545 |
+
csv_data = csv.DictReader(f)
|
| 546 |
|
| 547 |
# # Convert the CSV data to a list of dictionaries
|
| 548 |
data_list = []
|
| 549 |
+
for row in csv_data.iterrows():
|
| 550 |
data_list.append(dict(row))
|
| 551 |
|
| 552 |
# # Convert the list of dictionaries to JSON
|
|
|
|
| 556 |
# #with open("smalljson.json", "r+") as fi:
|
| 557 |
# #data = fi.read()
|
| 558 |
# #fi.seek(0)
|
| 559 |
+
with open('detailedResults.json','w+') as fi:
|
| 560 |
data = json.load(fi)
|
| 561 |
# #st.write(data)
|
| 562 |
# # fi.seek(0)
|