Spaces:
Sleeping
Sleeping
File size: 504 Bytes
cf6dc04 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import os
import json
import pandas as pd
from constants import RESULTS_DIR
def load_all_results():
all_data = []
for file in os.listdir(RESULTS_DIR):
if file.endswith(".json"):
with open(os.path.join(RESULTS_DIR, file), "r") as f:
data = json.load(f)
if isinstance(data, list):
all_data.extend(data)
elif isinstance(data, dict):
all_data.append(data)
return pd.DataFrame(all_data)
|