Skip to content

Commit

Permalink
attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsuss committed Oct 6, 2024
1 parent 4bd71cc commit fea23ba
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Import code from the src/ directory
import json
import pandas as pd

from src.fetch import get_data
from src.save import write_data
#from src.save import write_data
from os.path import abspath

data = get_data()
write_data(abspath("./data/superforecasts.csv"), data)
#write_data(abspath("./data/superforecasts.csv"), data)

# Step 1: Parse the JSON string to a Python object (list of dictionaries)
json_data = json.loads(data)

# Step 2: Convert the parsed JSON into a Pandas DataFrame
df = pd.DataFrame(json_data)

df.to_csv(abspath("./data/superforecasts.csv"))

0 comments on commit fea23ba

Please sign in to comment.