Skip to content

Commit 1b8e4c2

Browse files
committed
format
1 parent ce62b22 commit 1b8e4c2

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/imf_reader/weo/api.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,9 @@ def _align_schema(df: pd.DataFrame) -> pd.DataFrame:
164164
# Only apply where SCALE_CODE is present and > 0
165165
scale_exponent = pd.to_numeric(df["SCALE_CODE"], errors="coerce")
166166
has_scale = scale_exponent.notna() & (scale_exponent > 0)
167-
df.loc[has_scale, "OBS_VALUE"] = (
168-
pd.to_numeric(df.loc[has_scale, "OBS_VALUE"], errors="coerce")
169-
/ (10 ** scale_exponent[has_scale])
170-
)
167+
df.loc[has_scale, "OBS_VALUE"] = pd.to_numeric(
168+
df.loc[has_scale, "OBS_VALUE"], errors="coerce"
169+
) / (10 ** scale_exponent[has_scale])
171170

172171
# Convert SCALE_CODE from exponent to multiplier to match legacy format
173172
df["SCALE_CODE"] = scale_exponent.map(SCALE_MULTIPLIERS)

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)