From 22a2bbae39ddae903f2eebf822ab2ed9f54c88df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 27 Apr 2021 11:32:34 -0400 Subject: [PATCH] The payoff: combine multiple entries in the same day into one larger time unit --- pomodoro_to_harvest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index d535447..7fa57cb 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -11,3 +11,6 @@ timelog["time"] = 30 # the day we want to associate a time entry with. PomodoroPrompt saves as UTC. timelog["date"] = timelog["started"].dt.tz_convert("US/Pacific").dt.date timelog["day_of_week"] = pd.to_datetime(timelog["date"]).dt.day_name() + +# Condense duplicate entries by date, summing the minutes spent. +timelog = timelog.groupby(["date", "description"]).agg({"time": ['sum']})