Skip to content

Commit

Permalink
sdr type
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-rivera committed Jul 10, 2023
1 parent add7c24 commit 55fa530
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bblocks/cleaning_tools/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def clean_number(number: str | pd.Series, to: Type = float) -> float | int:
number = pd.to_numeric(number, errors="coerce")

if to == float:
return number
return number.astype(float)

if to == int:
return number.round().astype("Int64")
Expand Down
2 changes: 1 addition & 1 deletion bblocks/import_tools/sdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def clean_df(df: pd.DataFrame, date: str) -> pd.DataFrame:

return (
df.melt(id_vars="entity", value_vars=["holdings", "allocations"])
.pipe(clean_numeric_series, series_columns="value")
.pipe(clean_numeric_series, series_columns="value", to=float)
.rename(columns={"variable": "indicator"})
.reset_index(drop=True)
.assign(date=date)
Expand Down

0 comments on commit 55fa530

Please sign in to comment.