mirror of
https://github.com/PR0M3TH3AN/python_charts.git
synced 2026-10-27 08:50:39 +00:00
Drop NaN rows before validation
This commit is contained in:
1 parent
02a89740bb
commit
f33fac02c2
2 files changed
+64
-18
No files matched your search
@@ -351,11 +351,20 @@ def main(argv: list[str] | None = None) -> plt.Figure:
|
||||
# 15) FETCH SERIES
|
||||
# ──────────────────────────────────────────────────────────────────────────
|
||||
try:
|
||||
btc, m2 = fetch_series(start_dt, end_dt, args.btc_series, args.m2_series, args.db)
|
||||
btc, m2 = fetch_series(
|
||||
start_dt, end_dt, args.btc_series, args.m2_series, args.db
|
||||
)
|
||||
except FileNotFoundError as fnf:
|
||||
print(fnf, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
# ──────────────────────────────────────────────────────────────────────────
|
||||
# DROP ANY ROWS WITH NULL "value" BEFORE VALIDATION
|
||||
# ──────────────────────────────────────────────────────────────────────────
|
||||
# (GLOBAL_M2 often has one or two trailing NaNs for "unpublished" months.)
|
||||
btc = btc.dropna(subset=["value"])
|
||||
m2 = m2.dropna(subset=["value"])
|
||||
|
||||
# If either series is empty, print a friendly message and exit:
|
||||
if btc.empty:
|
||||
print(
|
||||
|
||||
Reference in new issue
Block a user