Skip to content

Commit

Permalink
Fix NIHPI Table Injest (#395)
Browse files Browse the repository at this point in the history
#HOTFIX: 2022 update included a trailing NAN row in Table 4 because of an out-of-table annotation
  • Loading branch information
andrewbolster authored Aug 17, 2022
1 parent 9a6aa71 commit 4ec1986
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ pull_request_rules:
- check-success=tests 3.9 / macos-latest
actions:
merge:
method: squash
method: squash
1 change: 1 addition & 0 deletions src/bolster/data_sources/ni_house_price_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def basic_cleanup(df: pd.DataFrame, offset=1) -> pd.DataFrame:
# in Q2/4, so fill it downwards
if set(df.keys()).issuperset({"Year", "Quarter"}):
df["Year"] = df["Year"].astype(float).fillna(method="ffill").astype(int)
df = df.dropna(how="any", subset=["Year", "Quarter"])

# In Pandas we can represent Y/Q combinations as proper datetimes
# https://stackoverflow.com/questions/53898482/clean-way-to-convert-quarterly-periods-to-datetime-in-pandas
Expand Down

0 comments on commit 4ec1986

Please sign in to comment.