diff --git a/frontend/src/pages/Stats.tsx b/frontend/src/pages/Stats.tsx index 3b6b21f..f7ff314 100644 --- a/frontend/src/pages/Stats.tsx +++ b/frontend/src/pages/Stats.tsx @@ -23,7 +23,7 @@ const StatPage = () => { useEffect(() => { // Posts per Day axios - .get("http://localhost:5000/stats/posts_per_day") + .get("http://localhost:5000/stats/events_per_day") .then(res => { setData(res.data.filter((item: any) => new Date(item.date) >= new Date("2025-06-01"))); setLoading(false); diff --git a/server/app.py b/server/app.py index 6f92486..46932e7 100644 --- a/server/app.py +++ b/server/app.py @@ -34,7 +34,7 @@ def upload_data(): return jsonify({"message": "File uploaded successfully", "event_count": len(stat_obj.df)}), 200 -@app.route('/stats/posts_per_day', methods=['GET']) +@app.route('/stats/events_per_day', methods=['GET']) def posts_per_day(): if stat_obj is None: return jsonify({"error": "No data uploaded"}), 400 diff --git a/server/stat_gen.py b/server/stat_gen.py index 2d6f4c7..526e510 100644 --- a/server/stat_gen.py +++ b/server/stat_gen.py @@ -66,7 +66,7 @@ class StatGen: return ( self.df - .groupby(["weekday", "hour"]) + .groupby(["weekday", "hour"], observed=True) .size() .unstack(fill_value=0) .reindex(columns=range(24), fill_value=0)