aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2023-11-27 20:21:37 -0800
committerPinapelz <yukais@pinapelz.com>2023-11-27 20:21:37 -0800
commitcc2d8e05f3fed5dfde9eead2cbe6eb81c94e3026 (patch)
tree8ec23afb55b645d5934777b692164d21ef1d2b19
parente029b918e80addad3a944c9f4bbc3bfe37338246 (diff)
fix: scalar value conversion numpy warning
-rw-r--r--backend/app.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/app.py b/backend/app.py
index 5c39182..38121ec 100644
--- a/backend/app.py
+++ b/backend/app.py
@@ -97,7 +97,8 @@ def get_channel_information(channel_name):
model.fit(X, y)
next_milestone = find_next_milestone(current_subscriber_count)
days_until_next_milestone = (next_milestone - model.intercept_) / model.coef_
- next_milestone_date = (df.index[0] + pandas.Timedelta(days=int(days_until_next_milestone))).date()
+ days_until_next_milestone_scalar = int(days_until_next_milestone[0])
+ next_milestone_date = (df.index[0] + pandas.Timedelta(days=days_until_next_milestone_scalar)).date()
time_until_next_milestone = (next_milestone_date - datetime.datetime.now().date()).days
channel_data["next_milestone_date"] = str(next_milestone_date)
channel_data["days_until_next_milestone"] = str(time_until_next_milestone)
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage