Spaces:
Runtime error
Runtime error
import pandas as pd | |
import os | |
def log(hypothesis, result): | |
path = "data/log.csv" | |
if os.path.exists(path): | |
df = pd.read_csv(path) | |
else: | |
df = pd.DataFrame(columns=['hypothesis','result']) | |
df = pd.concat([df, pd.DataFrame({'hypothesis':[hypothesis],'result':[result]})]) | |
df.to_csv(path, index=False) | |
return df.tail(5) |