-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_claims.py
49 lines (39 loc) · 1.03 KB
/
update_claims.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 cspell:disable -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.5.1
# kernelspec:
# display_name: dev
# language: python
# name: dev
# ---
# +
import joblib
import datetime
from pathlib import Path
import pytoml
import us
# -
home = str(Path.home())
# %run "/home/gsinha/admin/db/dev/Python/projects/models/claims/common.py"
START_DATE = datetime.date(1995, 1, 1)
with open(home + "/.config/gcm/gcm.toml", "rb") as f:
config = pytoml.load(f)
FRED_API_KEY = config["api_keys"]["fred"]
# +
# %%time
fred_fname = "../data/fred_data"
states = [x.abbr for x in us.STATES] + ["DC", "US"]
ic_df, fred_df, ic_date, w_52_pct_chg_df = get_labor_data(states)
ic_df = ic_df.interpolate()
with open(fred_fname + ".pkl", "wb") as f:
joblib.dump(
{"ic_df": ic_df, "fred_df": fred_df, "w_52_pct_chg_df": w_52_pct_chg_df, "ic_date": ic_date}, f
)
# -